C++ · Files and streams
The loop many people write first to read a whole file counts its last value twice, because of when the stream notices the end.