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
Science,
1 month ago
Math,
1 month ago
Social Sciences,
2 months ago
World Languages,
2 months ago
Hindi,
10 months ago
Physics,
10 months ago
Math,
10 months ago