Recommended Posts

ok I need to input data.. so I add something like

while ((a = prompt_number ( "enter Number or EOF to quit: " )) != EOF ) ;

the not EOF part is getting me.. is this a trick as eof fro input is control-C right... which kills the program correct?? so an I really just saying .. run program forever.. and I have ot kill the program with control-C..

note since I am checking for correct number input I can't enter EOF as a answer.

Link to post
Share on other sites
the not EOF part is getting me.. is this a trick as eof fro input is control-C right... which kills the program correct??

EOF is ^D. ^C sends an interrupt signal.

note since I am checking for correct number input I can't enter EOF as a answer.

Well, you can, but it calls for a slightly a more interesting approach to input prompts.

Edited by jcl
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...