Just out of curiosity: from which post did you copy it? There are still the line numbers and the phrase “Edit & Run”...
It has a couple of problems, but it shouldn’t be hard to solve them
how i can use space in string?
Usually putting spaces inside strings just works.
What’s exactly your issue?
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
You should compile your code before posting it. This code would not compile on my system.
There are several problems with the code you have posted. The arrays, the for loops and the fact the for loops will only loop nine times before the program crashes.
The use of std::strings and getline are to be able to deal with spaces where cin will not. The code dealing with inputting a name will deal with spaces just fine.
The code posted is a good start, but needs some work and additional code.
If you are really interested in fixing this program and understanding how it works I will help all I can , but show some interest. Make some attempt to people that you have done something.