What is getchar() function ? Whats its purpose?
Getchar () takes only 1 character at a time... and if u want to take multiple character u can use gets()
That type of input is used to get a character (one single letter) from the user.
True DReaMs the main purpose of getchar is not holding the screen. It is just a side effect. The real use of it is to wait until user enters a char to the console and get/return it.
I think you are c student In simple word getchar () is used to hold the screen
getchar(), as its name says, helps us to read a single character from the console. For example, char foo = getchar(); putchar(foo); // puts the char on to the console Note: You've to include <cstdio> (in C++) or <stdio.h> (in C) to use this function.
Seniru Pasan thanks to you Actually I dont know all stuffs about c. I am new to it.
It gives you one character as input from user.