Problem with convert and data input

Hi everybody!

I'm a newbie to C++ and I need some help to improve my skills in c++.

*When you make input data "cafe monde" into a string variable, the variable only accept "cafe" and not the white space and "monde". What should I do to retrieve white spacem "monde" and "cafe" ini the same string variable after data input?

*Another obstacle I'm facing is to convert char to string. In the char it also can contain white space. I tried findin' the solution on Internet but I don't really understand the conversation or the code don't work.

/Fullmetalboy
Can you please share the code with us?
For the first problem use getline:

1
2
string input;
getline(cin,input);


To convert a character into a string, use this:
1
2
char character='A';
string charString(1,character);
Topic archived. No new replies allowed.