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 are different types of pointers?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
How is = symbol different from == symbol in c programming?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is the benefit of using an enum rather than a #define constant?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What is a global variable in c?
What is call by value in c?
What does void main () mean?
What is a structural principle?
explain how do you use macro?
in iso what are the common technological language?
What are 'near' and 'far' pointers?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is a volatile keyword in c?