What is EOF. How is it generated? Which key corresponds to "end of file" on the keybord??

Recommended Answers

All 4 Replies

EOF is a macro defined in <stdio.h>. It's not the value of a keypress, rather it's an "impossible" value returned by various input functions to signal that end-of-file was detected.

Which key corresponds to "end of file" on the keybord??

That depends on your operating system. On Windows systems the key combination is Ctrl+Z. On Unix, Linux, and Mac OSX systems, the key combination is Ctrl+D. If you're not on one of those (they're the most common around here), please specify.

I am running turbo c- under DOS

Are you really running DOS, or just a simulated DOS in Windows? Anyway, it's the same as Windows: Ctrl+Z.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.