what is the difference between getch() and getchar()?
Answer Posted / shivani
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() is not waiting to press enter to show output on
screen.
but getchar() is waiting to press enter to show output.
| Is This Answer Correct ? | 9 Yes | 10 No |
Post New Answer View All Answers
What is the maximum length of an identifier?
What is default value of global variable in c?
What is bubble sort in c?
What is the difference between exit() and _exit() function?
What is 1d array in c?
What is the difference between char array and char pointer?
What are run-time errors?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
diff between exptected result and requirement?
Tell me what is the purpose of 'register' keyword in c language?
What is a buffer in c?
What is int main () in c?
all c language question
Once I have used freopen, how can I get the original stdout (or stdin) back?