Reputation: 1431
i want to store a string entered by the user including the space characters into the following array
char array[100];
how can i do it.
Upvotes: 0
Views: 356
Reputation: 480
Documentation for getline can be found here: http://cplusplus.com/reference/iostream/istream/getline/
Upvotes: 0
Reputation: 499
You can use the following to get the user-entered string to a string object, then convert it to whatever you need:
string c;
getline(cin, c);
Upvotes: 3