Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Its been a long time i wrote my codes in C++ and i've forgotten many things. Pls can some1 help me with how i can read a single string containing white spaces from standard input, without having to form a loop for this; something like a name (''James Berk Brown''). Pls any respond would be appreciated. 10x
Posted
Comments
Mohibur Rashid 21-Sep-12 4:35am    
did you check google?
Emejulu JVT 21-Sep-12 4:46am    
yes i did but i didn't see stuffs that matched the specific
Andrewpeter 21-Sep-12 4:59am    
You search with words "how to use scanf in C++". Good luck!

1 solution

'getline' is the function you are looking for.

http://www.cplusplus.com/reference/string/getline/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900