gets()
- It is used to read a single string with white spaces.
- It is terminated by entering the key or at the end of line.
Example:
char str[10];
gets(str);
getchar(), getch( )
- It is used to read a single character at a time.
- getchar() function requires enter key to terminate input while getch() does not require.
- getch()function does not display the input character while getchar()function displays the input character on the screen.
Example:
char ch;
ch = getchar();
ch = getch();