複製鏈接
請複製以下鏈接發送給好友

putch

鎖定
在當前光標處向屏幕輸出字符ch,然後光標自動右移一個字符位置。
中文名
putch
外文名
putch
用 法
int putch(int ch)
説    明
非ANSI C標準

目錄

putch基本信息

函數名: putch
用 法: int putch(int ch),其中參數ch為要輸出的字符
返回值:如果輸出成功,函數返回該字符;否則返回EOF。
説明:非ANSI C標準

putch程序例

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;
}