--- In [email protected], "allan_blackford" <[EMAIL PROTECTED]>
wrote:
>
> I'm totally new to C++. I was messing around with reading and
> writing text from a text file. I read and displayed the string, "My
> Name is: ".
>
> Then prompt for a name, append the file, then re-open and re-read
> the file with the appended text. Everthing works but the re-reading
> of the file. When I step through the code, it appears that when I
> try to re-read the file, it is already at the end of the file.
> Here's the
> code...
>
> #include <fstream>
> #include <iostream>
> #include <string>
>
> using namespace std;
>
<snip>
>
> while (getline (input, text))
> {
> cout << text << endl;
> }
> input.close();
>
This might be a little better way to determine eof/error!
~Saurabh
<snip>