I'm working on an assignment in which we aren't allowed to use arrays or functions. So i need to use loops to split words from a text file. I got most of the code working but i get an error at this part where the loop doesn't exit when i come to a space in the text
code:
for(int i=0;i<line.length(); i++)
{
n++;
//stringstream(input.substr(n,1)) >> num1;
stringstream(line.substr(n,1) ) >> character;
if(character == ' ')
{
break;
}
else
{
word += character;
}
}