On the implementation of CLRSRC function under Linux

Source: Internet
Author: User

In Windows, C has a library conio.h, implemented a lot of functions, but Linux C does not have this library, the internal functions need to implement their own.

CLRSRC a realization of the function of clear screen:
void Clrscr (void) {System ("clear");//requires header file Stdlib.h}
Call System ("clear")
An implementation method of Getch () function
#include <stdio.h> #incldue <stdlib.h>int main () { char C; printf ("Input a char:"); System ("Stty-echo"); C=getchar (); System ("Stty echo"); printf ("You have inputed:%c \ n", c); return 0;}
This calls the system ("Stty-echo") and System ("Stty echo") implementation of the input in which is not realistic

  

There are some other functions not implemented under this header file, Welcome to add! If there is any mistake, please correct me.

On the implementation of CLRSRC function under Linux

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.