04-24-2011, 02:08 AM
This is because you shouldn’t make use of the cin method of obtaining input from the user. The cin will stop when it sees a blank space.
If you want to use character array for complete name including blank space, you can use gets() function.
Try this code:
If you want to use character array for complete name including blank space, you can use gets() function.
Try this code:
Code:
#include<iostream.h>
main( )
{
char name[20];
cout<<"Enter your full name";
gets(name);
cout<<name;
system("pause");
}