|
-
May 23rd, 2012, 08:38 AM
#1
character array please Help!!!
void main()
{
char name[20];
name = "omshanti";
cout << name;
}
In the above program , if we won't initialize name as the type of its definition , why there's compile time error :
cannot convert from 'char [9]' to 'char [20]'.???????
while using other data type such as int , float , double , we can initialize them after defining them .But same is not the case with character string. WHY???????
TANUSHREE-AGRAWAL...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|