what is the difference between getch() and getchar()?
Answer Posted / pinky
getchar() is a function call: it reads in a single
character and waits for the user to hit 'enter key' before
reading the character. This line is included because many
compiler environments will open a new console window, run
the program, and then close the window before you can see
the output. This command keeps that window from closing
because the program is not done yet because it waits for
you to hit enter. Including that line gives you time to see
the program run.
getch() returns back on reading any character(a-z) or any
hit to the keyboard.
| Is This Answer Correct ? | 34 Yes | 12 No |
Post New Answer View All Answers
the question is that what you have been doing all these periods (one year gap)
How many bytes is a struct in c?
What is the size of structure in c?
How can I read in an object file and jump to locations in it?
How reliable are floating-point comparisons?
What is calloc()?
What is operator precedence?
What is register variable in c language?
When should volatile modifier be used?
Explain what is operator promotion?
How do I read the arrow keys? What about function keys?
How can I change the size of the dynamically allocated array?
What is the purpose of sprintf() function?
What is masking?
How will you delete a node in DLL?