Saturday, December 4, 2010

end-of-stream (eos)


vector<int> ints;
inserter(ints, ints.begin()));

This copies any ints from standard input to the vector ints. The name of the character that ends this stream is end-of-stream (eos), also known as end-of-file.

The keystroke to generate this on Unix, and later versions of Windows is ctrl-d. On MSDOS it was ctrl-z. Note that when you call <stdio.h>::getc() on the EOS, it returns the constant EOF (which is typically -1, but is implementation dependent).

No comments:

Post a Comment