正在加载图片...
成语言教堂灯片版>第章数摇输入与输出 3.2数据输入 字符输入函数 格式: getchar( 功能:从键盘读一字符 返值:正常,返回读取的代码值;出错,返回EOF(-1) 例 /*ch34.c* #include <stdio. h> maino 运行结果 t int c Enter a character: A printf("Enter a character: );A->hex41 c=getchar; printf(%oC--->hex%/ox\n",,C; BACK首页→C语言教学→幻灯片版→第三章 数据输入与输出 格式:getchar( ) 功能:从键盘读一字符 返值:正常,返回读取的代码值;出错,返回EOF(-1) ◼ 字符输入函数 例 /*ch3_4.c*/ #include <stdio.h> main() { int c; printf("Enter a character:"); c=getchar(); printf("%c--->hex%x\n",c,c); } 运行结果: Enter a character:A A--->hex41 3.2 数据输入
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有