Unable to get full enter value under Windows console

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.