Press Any Key to Continue in C
Press Any Key to Continue
Press Any Key to Continue
Author | Message |
---|---|
Press Any Key to Continue What has everyone found to be the best way to do a 'press any key to char ch; ch = getch(); The compiler doesn't like this because I don't do anything with ch. | |
Thu, 15 May 1997 16:22:26 GMT | |
Press Any Key to Continue : ch = getch(); just take out the ch= then. ie. getch(); on a single line. i've never heard of a compiler complaining about that (or ch=getch() Al | |
Fri, 16 May 1997 17:58:59 GMT | |
Press Any Key to Continue : char ch; btw, in dos, i usuly put: if(getch()==0) getch(); this way if the user presses one of the F keys or arrow keys for exemple, good luck. Al | |
Fri, 16 May 1997 18:01:51 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to I don't think there is a 'best' way, it is all based on your specific Quote: >ch = getch(); > The compiler doesn't like this because I don't do anything with ch. You can forget the 'ch =' part and just have 'getch();' and that will work. MAR. | |
Fri, 16 May 1997 11:50:40 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to > char ch; > ch = getch(); > The compiler doesn't like this because I don't do anything with ch. You need to understand the difference between a compiler error and a #include <stdio.h> main() Quote: } ------------------------------------------------------------- | |
Sat, 17 May 1997 00:48:42 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to > char ch; > ch = getch(); > The compiler doesn't like this because I don't do anything with ch. 1) Are you saying that your compiler is complaining about un-optimized code ? 2) You could f.ex. use: 3) Now getch() is not standard but assuming your getch() acts like it Joke: Where is the ANY key on my keyboard ? Arne Arne Vajh?j local DECNET: KO::ARNE WWW URL: http://www.hhs.dk/~arne/arne.html | |
Sat, 17 May 1997 03:39:46 GMT | |
Press Any Key to Continue Last line of the program: print out ch, then clear screen. --Ken ======================================================= | |
Sat, 17 May 1997 05:00:18 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to Related topic. One of your repliers mentioned using "Press spacebar to continue" Tom Prodehl | |
Sat, 17 May 1997 04:21:26 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to One way to do it is to make the message "Enter <a specific I'm inclined to think that any case where you are justified in -- *** Count Templar, ELITE, Cobra Mk III (FM-287) *** | |
Sat, 17 May 1997 07:05:32 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to I don't think there is a 'best' way, it is all based on your specific Quote: >ch = getch(); > The compiler doesn't like this because I don't do anything with ch. You can forget the 'ch =' part and just have 'getch();' and that will work. MAR. | |
Fri, 16 May 1997 11:50:40 GMT | |
Press Any Key to Continue Quote: > What has everyone found to be the best way to do a 'press any key to First, you'll need an 'any' key on your keyboard. They are pretty rare Since people could not agree on which key to use after the 'any' key was Quote: >Not printing the prompt, but accepting the key. This may work for MS-DOS systems, but not, for example, for UNIX, Quote: > The compiler doesn't like this because I don't do anything with ch. Hmm... you should use an int for ch. Alternatively, you could just The joy of engineering is to find a straight line on a double | |
Sun, 18 May 1997 00:50:53 GMT | |
Press Any Key to Continue [}> I work for an End User Support group. I've actually gotten a call with this | |
Sun, 18 May 1997 05:30:42 GMT | |
Press Any Key to Continue : >ch = getch(); : This may work for MS-DOS systems, but not, for example, for UNIX, Sorry but I don't have anything to do today, thus: Thomas, I believe there's a getch function in UNIX (#include And he if you don't want curses, then you may try getc(), which is the Best regards, Carlos... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Mon, 19 May 1997 05:42:46 GMT | |
Press Any Key to Continue :> What has everyone found to be the best way to do a 'press any key to here is A Portable Way: printf("Press <enter> to continue:\n"); :>ch = getch(); :You can forget the 'ch =' part and just have 'getch();' and that will work. Um... which function in (ch = getch()) was standard-ANSI in the first place? | |
Mon, 19 May 1997 10:33:21 GMT | |
Press Any Key to Continue Quote: >> What has everyone found to be the best way to do a 'press any key to Yeah, I use: Press A Key To Continue... That way the clueless can press the "A" key, and the clueful can -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Mon, 19 May 1997 00:24:39 GMT | |
Page 1 of 2 | [ 25 post ] | Go to page: [1] [2] |
Source: http://computer-programming-forum.com/47-c-language/07170dbe3e3d2825.htm
0 Response to "Press Any Key to Continue in C"
Post a Comment