Reputation: 85
ifstream inputFile("blah.txt");
char c;
inputFile.read((char *)(&c), 1);
Let's say at the read, the file has already reached the EOF
.
What value ends up in c
?
Upvotes: 0
Views: 89
Reputation: 363
Characters are extracted and stored until any of the following conditions occurs: ... end of file condition occurs on the input sequence ...
Read more at: http://en.cppreference.com/w/cpp/io/basic_istream/read
So your char
will contain the same value as before.
Upvotes: 2