S
Samuele Armondi
Hi,
I'm trying to use cin to capture some input from the console, but it always
seems to consider a space as the end of the string. I tried to use
cin.getline() but it only works for char arrays, and I would rather use
strings. At the moment, I'm using getline to read the input into a char
array and I'm then making a string out of it. Is there a more elegant way of
doing this?
Thanks in advance,
S. Armondi
I'm trying to use cin to capture some input from the console, but it always
seems to consider a space as the end of the string. I tried to use
cin.getline() but it only works for char arrays, and I would rather use
strings. At the moment, I'm using getline to read the input into a char
array and I'm then making a string out of it. Is there a more elegant way of
doing this?
Thanks in advance,
S. Armondi