I have the following piece of code for Dev C++;
include<iostream>
usimg namespace std;
main()
{
char*names;
cout<<"enter name and surname";
cin>>names;
... //represents other code
}
when a single string is stored in variable names, there is no problem. The problem is that I cant figure out how to store two words separated by a space in a single variable. Can anyone help me out with this?
include<iostream>
usimg namespace std;
main()
{
char*names;
cout<<"enter name and surname";
cin>>names;
... //represents other code
}
when a single string is stored in variable names, there is no problem. The problem is that I cant figure out how to store two words separated by a space in a single variable. Can anyone help me out with this?