John Eipe wrote:I read in a book that end of file could be given as input for a program. For Windows, it's <Ctrl> + Z.
But it never works.
Hmmm, what about using your own terminator?
It's a bit retro (1960's-retro to be exact), but it still does the job and it saves the Ctrl-D/Z problem that Campbell mentioned.
Just pick a
string which should never appear in real life, and have your program terminate when it receives it.
FYI: "classic" terminators for punched-card decks were things like '$$$$' or 'ZZZZ' - which may well be where Ctrl-Z came from. :-)
HIH
Winston
Oops - Just realised this is a 9 year old
thread. My apologies. :-)