词条 | putch |
释义 | 函数名: putch 功 能: 在当前光标处向文本屏幕输出字符ch,然后光标自动右移一个字符位置。 用 法: int putch(char ch),其中参数ch为要输出的字符。 返回值:如果输出成功,函数返回该字符;否则返回EOF。 说明:非ANSI C标准 程序例1:(VC6.0中运行通过) /*putch例程*/ #include <stdio.h> #include <conio.h> int main(void) { char ch = 0; printf("Input a string:"); while ((ch != '\\r')) { ch = getch(); putch(ch); } return 0; } 程序例2:(在TC下运行通过) #include <stdio.h> #include <conio.h> int main() { int i; char *ch="ok!welcome to here!"; textbackground(0); clrscr(); for(i=1;i<8;i++) { window(10+i*5,5+i,30+i*5,15+i); textbackground(i); clrscr(); } textcolor(RED); clrscr(); cprintf(ch); cputs(ch); putch(3); getch(); return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。