How to suspend a program in C Language

Source: Internet
Author: User

How to suspend a program in C Language
# Include "stdio. h "getchar () is used to retrieve the carriage return # include" string. h "# include" stdlib. h "system (" pause ") # include" conio. h "getch ()

Paste an example of another person: How do I remove the Enter key when reading characters using getchar? In the c language of linux, when you want to read a character (such as 'Z'), you can use the c = getchar () function, enter Z in the terminal, and then press the Enter key, in this case, Z characters are stored in c. When we use c = getchar () again to obtain another character (for example, 'q'), we get a carriage return. Therefore, we usually use getchar twice to avoid the influence of carriage return. C = getchar (); // get Z getchar (); // read the carriage return from the buffer ...... ...... ...... C = getchar (); // used to read Q getchar (); // read the carriage return from the buffer.

Related Article

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.