|
-
April 21st, 2003, 08:20 AM
#1
malloc problem?
Hi
I need your help in the following problem
suppose i have to store a name of a person which i take at runtime from the user...
i am using the following code..
.
.
.
.
char* strNameUser;
strNameUser = (char*)malloc(sizeof(char*));
cout<<"Enter your name\n";
cin>>strNameUser;
.
.
.
.
my friends says that this will cause the error sometimes...but i do not think so,
please help me in understanding this..
if this code causes problem then suggests me the correct code...
Thanks
Vishal
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
|