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

cputs

鎖定
在當前光標處向文本屏幕輸出字符串str,光標自動右移字符串長度個字符位置。 用 法:在TC2.0中函數原型是 int cputs(const char *str); ,因此TC2.0中如果該函數調用成功函數返回最後一個輸出的字符;在VC6.0中,函數原型描述為:int _cputs( const char *string );,若成功則返回0,否則返回一個非0值。
外文名
cputs
屬    性
函數
用 法
TC2.0中函數原型
描    述
若成功則返回0
函數名: cputs
程序例1:(VC6.0中運行通過)
#include <conio.h>
int main(void)
{
/* 輸出一些文本 */
cputs("This is within the window\r\n");
/* 等待按鍵 */
getch();
return 0;
}
程序例2:(TC2.0中運行通過)
#include <stdio.h>
int main(void)
{
/* clear the screen */
clrscr();
/* create a text window */
window(10, 10, 80, 25);
/* output some text in the window */
cputs("This is within the window\r\n");
/* wait for a key */
getch();
return 0;
}