Problem Description:
Collected by netizens analysis:
http://bbs.csdn.net/topics/370084904
Because the C language and UNIX developers are co-workers ...
The C language uses a uniform \ n to indicate another line. Microsoft's DOS was affected by the 8-bit system mainstream OS cp/m, using \ r \ n to indicate another line. Mac uses \ r to indicate another line.
The C standard library hides the inconsistency of the platform, and all standard input and output (including standard file) operations are automatically converted to ensure that the language is always in \ n. Like GetChar (), fscanf (), printf () and so on.
Getch () is not a function of the C standard library, but rather a low-level console function, so no conversion is performed.
You cannot enter a carriage return (ASCII 13) through CIN, because the C + + standard library, like C, is automatically converted to \ n by the keyboard interrupt service read \ r \ n.
Unable to get full enter value under Windows console