Method of suspending program in C language

Source: Internet
Author: User
#include "stdio.h" GetChar () to remove carriage return # include "String.h" #include "stdlib.h" System ("pause") #include "conio.h" ge TCH () An example of someone else: how do I remove a return key when I use GetChar () to read a character? In the C language of Linux, you can use the C=getchar () function when you want to read a character (for example, ' Z '), enter z in the terminal, and then press the ENTER key, in which case the z character is stored in C. When we use C=getchar () again to get another character (say ' Q '), we get to the fact that it is a carriage return. So we usually use the GetChar two times to avoid the effect of carriage return. as follows: C=getchar ();//Get z GetChar ();//Enter the carriage return from the buffer read ... c=getchar ();//used to read Q GetChar ();//To read the carriage return from the buffer

Method of suspending program in C language

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.