>while (true) {
You don't break from this loop anywhere. It's going to continue looping forever, after a short time getline will start to fail and you'll get the output you posted. Try this instead:
while ( getline ( cin, input ) )
cout << input << endl;
At least that way the loop will stop when input is exhausted.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Let's see both of your test programs in their entirety. You said that one uses a loop and the other doesn't, and that this is the only difference between the two, yet that shouldn't have any effect on whether you get output or not.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401