Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "Osmium" <r124c4u102@comcast.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Need Help Displaying of Infix to postfix conversion |
| Date | 2016-08-22 16:05 -0500 |
| Message-ID | <e217p4Fni15U1@mid.individual.net> (permalink) |
| References | <f3b33761-dc0c-4902-b8ce-e50f2c3430c9@googlegroups.com> <rmjjrbp57ba3ecuiv430vtirnq5drjelmd@4ax.com> <d871895a-22a9-4a41-a9e9-854fda3feb1d@googlegroups.com> <jjcmrbl6d3sh3741bibrpk7ms53d7snct0@4ax.com> <f043d5ae-7600-43ed-ba68-1c3f12241b20@googlegroups.com> |
<supercat@casperkitty.com> wrote: > On Monday, August 22, 2016 at 12:19:02 PM UTC-5, Barry Schwarz wrote: >> Probably all true but in the case under discussion there already was a >> \n sitting in the buffer (residue from the call to scanf) waiting to >> be retrieved. I also doubt that an unseasoned new programmer would be >> concerned with this level of detail. > > The purpose of the code is to wait until the user actually hits a key. > An attempt to read input from stdin when it isn't redirected will grab > character input until the user hits return/enter, anything after that > will be left pending until either getch() is called, or until there is > an attempt to read more data from stdin after the newline (in the latter > case, input will be grabbed until the next newline). > >> The point that not everyone has conio.h and getch remains valid. Using >> them unnecessarily reduces the number of potential responders which is >> counter-productive when asking questions here. > > There is no reason that any C programmer shouldn't have a general idea of > what those things do on systems that support them. Some systems open up a > console window when launching a program, and close that window when the > program terminates; getch() will give users a chance to see what output > the program produced. Any hint that will help a poster get an on topic response is helpful, this group delights in pursuing tangents and diversions, and it is to the posters advantage if he can possibly avoid them Using getch() is a tangent magnet and is not needed in the situation you cite. Simply put a couple gethar() calls just before the final brace.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Need Help Displaying of Infix to postfix conversion Own IT <beltondavid1@gmail.com> - 2016-08-21 02:47 -0700
Re: Need Help Displaying of Infix to postfix conversion BartC <bc@freeuk.com> - 2016-08-21 11:17 +0100
Re: Need Help Displaying of Infix to postfix conversion Keith Thompson <kst-u@mib.org> - 2016-08-21 15:43 -0700
Re: Need Help Displaying of Infix to postfix conversion BartC <bc@freeuk.com> - 2016-08-21 22:17 +0100
Re: Need Help Displaying of Infix to postfix conversion Keith Thompson <kst-u@mib.org> - 2016-08-21 18:17 -0700
Re: Need Help Displaying of Infix to postfix conversion Barry Schwarz <schwarzb@dqel.com> - 2016-08-21 09:42 -0700
Re: Need Help Displaying of Infix to postfix conversion Siri Cruise <chine.bleu@yahoo.com> - 2016-08-21 11:24 -0700
Re: Need Help Displaying of Infix to postfix conversion BartC <bc@freeuk.com> - 2016-08-21 23:40 +0100
Re: Need Help Displaying of Infix to postfix conversion Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-22 00:13 +0100
Re: Need Help Displaying of Infix to postfix conversion BartC <bc@freeuk.com> - 2016-08-22 01:31 +0100
Re: Need Help Displaying of Infix to postfix conversion David Kleinecke <dkleinecke@gmail.com> - 2016-08-21 20:13 -0700
Re: Need Help Displaying of Infix to postfix conversion supercat@casperkitty.com - 2016-08-22 09:44 -0700
Re: Need Help Displaying of Infix to postfix conversion Barry Schwarz <schwarzb@dqel.com> - 2016-08-22 10:18 -0700
Re: Need Help Displaying of Infix to postfix conversion supercat@casperkitty.com - 2016-08-22 10:27 -0700
Re: Need Help Displaying of Infix to postfix conversion "Osmium" <r124c4u102@comcast.net> - 2016-08-22 16:05 -0500
Usenet in general and CLC in particular (Was: Need Help something or other...) gazelle@shell.xmission.com (Kenny McCormack) - 2016-08-25 11:48 +0000
csiph-web