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
What is the maximum length of an identifier?
What are the advantages and disadvantages of pointers?
why return type of main is not necessary in linux
show how link list can be used to repersent the following polynomial i) 5x+2
What is a program flowchart and how does it help in writing a program?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
Difference between strcpy() and memcpy() function?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What are the characteristics of arrays in c?
What is getch() function?
What is #define size in c?
When should structures be passed by values or by references?
What is difference between %d and %i in c?
Explain what is a pragma?
What is difference between array and structure in c?