+ 2

How would you print spaces with the sentence when user gives you an input using string arrays (code::blocks).

When i output a sentence using cout and cin it would just print the first word and stops after that example input:"i am going to market" Output: i

31st Mar 2017, 5:37 AM
Usama Rauf
3 Respuestas
+ 19
Tsk, you probably mean "How do I get the entire line instead of just the first word in a string". String array means a totally different thing. string str; getline(cin, str); cout << str; P.S. Burn CodeBlocks with fire and install Dev C++ 5.11 or VS2017.
31st Mar 2017, 5:40 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
you have to use getline(cin, stringvar); instead of std::cin >>
31st Mar 2017, 5:40 AM
David Najafi
David Najafi - avatar
+ 1
Lol thks again and i would burn it if it was not used for our studies
31st Mar 2017, 5:43 AM
Usama Rauf