cioconsole-applicationstdioc-standard-library

What is the difference between getch() and getchar()?


What is the exact difference between the getch and getchar functions?


Solution

  • getchar() is a standard function that gets a character from the stdin.

    getch() is non-standard. It gets a character from the keyboard (which may be different from stdin) and does not echo it.

    getch() is defined in conio.h, while getchar is in stdio.h