I can’t tell from the code that you inserted, but I'm going to go to a limb and assume that you are reading a string using the stream extraction operator (stream → string).
The stream extraction statement stops when it encounters spaces.
If this is not the case, can you show us how you fill in your line and what is its contents?
If I'm right, then you will need a different method of reading the contents into a string. std :: getline () is probably the easiest way to read from a file. It stops in newlines, not in spaces.
Edit based on an editable question: use this (doublecheck the syntax. I'm not in front of my compiler.):
std::getline(std::cin, analyze);
This should stop when you press enter.
jwismar
source share