zoukankan      html  css  js  c++  java
  • 关于Linux下conio头文件的实现

    在windows下,c语言有库conio.h,实现了不少函数,但是Linux c没有这个库,内部的函数需要自己实现。

    //clrsrc清屏函数的一种实现:
    void clrscr(void) {   system("clear");//需要头文件stdlib.h }
    //调用system("clear")
    //getch()函数的一种实现方法
    #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 ",c); return 0; }
    //这里调用了system("stty -echo")和system("stty echo")实现对其中的输入不现实出来

      

     还有一些这个头文件下其他的函数没有实现,欢迎大家添加!如有错误,欢迎指正。

  • 相关阅读:
    文本溢出隐藏与定位
    css基本属性 内边距 外边距及盒模型
    CSS基本属性2
    CSS基本属性
    CSS入门
    表格与表单
    列表与图片
    html标签类型
    HashMap和HashTable
    Map接口
  • 原文地址:https://www.cnblogs.com/Hocker/p/5357171.html
Copyright © 2011-2022 走看看