+ 1
cin output, difficulty with 'space'
I am currently having trouble with the 'cin' function extracting data from the input stream, where the input by the user contains a space. The input string is then truncated from the first instance of a space. As an example if I would enter a phrase like 'Hello World' when prompted to in the console from 'cin', then when using the function 'cout' the console outputs only the word 'Hello'. How do I go about having the console pull the entirety of a phrase rather than a truncated version of what was entered?
1 Réponse
+ 6
use cin.getline();