which function is used to inPut a
string with spaces in C++.
Answers
Answered by
0
Answer:
You can input string with white spaces by simply using scanf(" %[^\n]s",s);It will read string up to the newline character. Note the space before the '%' because it will flush all the whitespaces before the input string. If you will not put that then you will not get your desired result. Use getline(cin,s).
Similar questions
Math,
2 months ago
Chemistry,
2 months ago
Social Sciences,
4 months ago
World Languages,
4 months ago
Hindi,
11 months ago
Physics,
11 months ago
Math,
11 months ago