Jul 18, 2005 #1 worldwise Programmer Joined Jun 1, 2005 Messages 112 Location US Hi, I have a simple console application that continuously loops until the user enters an EOF (ctrl-z). I have finished everything except testing for the EOF. How do I do this? -kevin
Hi, I have a simple console application that continuously loops until the user enters an EOF (ctrl-z). I have finished everything except testing for the EOF. How do I do this? -kevin
Jul 18, 2005 #2 JurkMonkey Programmer Joined Nov 23, 2004 Messages 1,731 Location CA why ctrl-z? Upvote 0 Downvote
Jul 18, 2005 #3 earthandfire Programmer Joined Mar 14, 2005 Messages 2,924 Location GB Ctrl-Z is ASCII 26 Hope this helps. Upvote 0 Downvote
Jul 18, 2005 Thread starter #4 worldwise Programmer Joined Jun 1, 2005 Messages 112 Location US I have no idea. Thats how the teacher created the assignment (this is for a continuing education class, not a college course). I have completed the assigment to exit the loop when the user enters nothing but the teacher said "to exit on EOF (ctrl-z on intel machines)." I thought there might just be a special key word that I could test against? Upvote 0 Downvote
I have no idea. Thats how the teacher created the assignment (this is for a continuing education class, not a college course). I have completed the assigment to exit the loop when the user enters nothing but the teacher said "to exit on EOF (ctrl-z on intel machines)." I thought there might just be a special key word that I could test against?
Jul 18, 2005 Thread starter #5 worldwise Programmer Joined Jun 1, 2005 Messages 112 Location US earthandfire, Thanks. Would this be correct then?: //======================================================= string response; //response from user while (asc(response) != 26) { //blah blah } Upvote 0 Downvote
earthandfire, Thanks. Would this be correct then?: //======================================================= string response; //response from user while (asc(response) != 26) { //blah blah }
Jul 18, 2005 #6 earthandfire Programmer Joined Mar 14, 2005 Messages 2,924 Location GB I don't use C# but if your code translates to: while (asc(response) does not equal 26 then I would say yes. Hope this helps. Upvote 0 Downvote
I don't use C# but if your code translates to: while (asc(response) does not equal 26 then I would say yes. Hope this helps.
Jul 18, 2005 #7 stevexff Programmer Joined Mar 4, 2004 Messages 2,110 Location GB Must admit I've always thought ctrl-d was eof (on *nix terminals, at least) Upvote 0 Downvote