Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
HOOOOOOOOOW to GENERATE an EOF in WINDOWS command line?
[b][red]This message was edited by day9981 at 2007-1-9 22:47:14[/red][/b][hr]
[b][red]This message was edited by day9981 at 2007-1-9 22:46:28[/red][/b][hr]
No problem, I know prssing Ctrl+Z generates EOF in Windows, and pressing Ctrl+D generates EOF in Unix/Linux. Problem was it doesn`t always work in Windows command line, or i should say NEVER, when you press Ctrl+Z. No way to do so, like in the following program.#include
printf ("What is your name?
scanf( "%s", name ); // gets(name); also fails
if (name == NULL)
printf( "See you.
printf( "Hello, %s.
", name );
gets returns a NULL when it meets an EOF and no input entered. I want to see "See you." in the above program.
However, I tried it in Pelles C, VC, TC/C++, no way, no way to generate an EOF by pressing Ctrl+Z. Can anyone tell me how to?
0 · ·