Computer Science, asked by thomaselkd1963, 2 months ago

which function is used to inPut a

string with spaces in C++.

Answers

Answered by hardikkushwaha05
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