Look at the examples to see what do I want
string name
cin >> name;
This example does not allow spaces or multi line
char name[20];
cin.getline(name,20);
This example allow spaces and multi line
My question:
I want to using string data type with getline function or other function work with string data type allows mulitline and spaces
There’s a global getline function that works on strings.
You can get multiple lines by specifying a terminating character other than ‘\n’