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
How macro execution is faster than function ?
Why c is called procedure oriented language?
Is it possible to have a function as a parameter in another function?
What are multidimensional arrays?
What is putchar() function?
Hi can anyone tell what is a start up code?
Explain c preprocessor?
What is the g value paradox?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
Why is c called a mid-level programming language?
What is the difference between a free-standing and a hosted environment?
What are the differences between Structures and Arrays?
What is hungarian notation? Is it worthwhile?
How many keywords are there in c?
How many levels deep can include files be nested?