[comp.lang.c++] GNU C++ cin problem

mcdougal@gargoyle.uchicago.edu (thomas fenger mcdougal) (10/18/89)

should read in one word at a time, and halt after the
last word.
   It does not halt, but seems to continue 'reading'
the last word over and over after reading the previous
words.
   We are using GNU C++.
   Advice?
   Thanks in advance.

--Tom   (mcdougal@gargoyle.uchicago.edu)

mcdougal@gargoyle.uchicago.edu (thomas fenger mcdougal) (10/18/89)

(Sorry, I did something wrong and the mailer ate the first
part of my message.  Here is a reposting:)

I have a textbook that says

  char inbuf[200];
  while (cin >> inbuff)  { ... };

should read in one word at a time until it gets to the
end, at which point it should exit the loop.
  It reads words okay until it gets to the last word.
Instead of halting, it reads that last word over and
over and over and ...
  We are using GNU C++.
  Advice?
  Thanks in advance.

--Tom (mcdougal@gargoyle.UChicago.edu)