I think getch() is the most primitive input function of C, on which
getchar(),etc. are based. What may be happening is that getchar() uses getch() to take input, and keeps buffering it till getch() returns 26 (ascii for ctrl+z, which indicates the end of input in Windows) is encountered. It now senses that its the end of input and returns EOF.
daudiam -6 Junior Poster
Narue 5,707 Bad Cop Team Colleague
nezachem 616 Practically a Posting Shark
daudiam -6 Junior Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
daudiam -6 Junior Poster
Salem 5,199 Posting Sage
nezachem 616 Practically a Posting Shark
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.