函数名: cputs
功 能: 在当前光标处向文本屏幕输出字符串str,光标自动右移字符串长度个字符位置。 用 法:在TC2.0中函数原型是 int cputs(const char *str); ,因此TC2.0中如偶该函数调用成功函数返回最后一个输出的字符;在VC6.0中,函数原型描述为:int _cputs( const char *string );,若成功则返回0,否则返回一个非0值。
程序例1:(VC6.0中运行通过)
#include <conio.h>
int main(void)
{
/* 输出一些文本 */
cputs("This is within the window\\r\");
/* 等待按键 */
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\");
/* wait for a key */
getch();
return 0;
}