[杂谈] 9. C语言中getch()函数
发布日期:2021-05-12 23:15:31 浏览次数:12 分类:精选文章

本文共 2877 字,大约阅读时间需要 9 分钟。

getch()������������������C���������������������������������������������getchar()������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������

getch()���������������������������������������������������������������������������������������������������������������������������������������getchar()������������������������������������������������������������������������������ASCII������������������������������������������������������������������������������������������������������������������

���������������������

getch()������������������������������

#include 
int getch(void);

������������������������������������������ASCII���������������������������������������������������������������0���������������������������������0������������������������

������������

���������������������������������getch()���������

#include 
#include
#define _CRT_SECURE_NO_DEPRECATEint main() { int ch; while (1) { while (ch = getch()) { printf("���������������=%d\n", ch); } system("pause"); return 0; }}

���������������������������������������������������������������������������������������Enter���������������getch()���������������������������������������������������������������������������������������

������������

������getch()������������������������������

  • ������������������getch()���������<conio.h>������������������ Include���������������
  • ������������������������������getch()���������������������initscr()���������������������������������������endwin()���������������������������������������������������������������������������������
  • ������������������������������������Enter������������������������Windows������������Enter���������������\r\n���������������������������13���������Unix/Linux������������Enter������������\n���������������10���
  • ���������������������������������������������������������������������getch()������������������������������������������������������0���0xE0������������������������������������
  • ���getchar()���������

    getchar()������������������������������������gets()������������������������������������������������������������������������������������������������������������������������������

    • ���������������getch()���������������������������������������������������
    • ���������������getch()���������������������������getchar()���������������������������

    ������������

    getch()���������������������������������������������������������������������������������������������������������������������<stdlib.h>������systemb("pause")���������getchar()������������������������������������������������������������

    Important: ������getch()���������������������Unix������������Windows���������������������������������������������������������I/O���������������������

    上一篇:[C++系列] 66. 超详解C++阶段性总结思维导图
    下一篇:[C++系列] 65. IO流

    发表评论

    最新留言

    网站不错 人气很旺了 加油
    [***.192.178.218]2025年04月07日 04时37分44秒