In some situations, the scanf() function has one glaring weakness you need to fit the enter key before the function can be accepted what we have a type.
This is overcome by the getch( ) function, which will read a single character the instant it is typed without waiting for enter key to be typed followed character.
That you typed the getchar() is a macro and whereas the scanf( ) is a function.
The getchar( ) takes a single character at a time whereas scanf( ) can accept any number of inputs from the keyboard.
Scanf( ) accepts different type of data types whereas getchar( ) accepts only the character constants or digits or characters.
Recommended Questions
Recommended Files from Library
Useful Files
Users Joined
In some situations, the scanf() function has one glaring weakness you need to fit the enter key before the function can be accepted what we have a type.
This is overcome by the getch( ) function, which will read a single character the instant it is typed without waiting for enter key to be typed followed character.
That you typed the getchar() is a macro and whereas the scanf( ) is a function.
The getchar( ) takes a single character at a time whereas scanf( ) can accept any number of inputs from the keyboard.
Scanf( ) accepts different type of data types whereas getchar( ) accepts only the character constants or digits or characters.