C语言函数大全(t开头)

本文来自草根编程网: http://www.caogenbiancheng.com/?action-viewnews-itemid-126
函数名: tell
功能: 取文件指针的当前位置
用法: long tell(int handle);
程序例:
#include
#include
#include
#include
int main(void)
{
int handle;
char msg[] = "Hello world";
if ((handle = open("TEST.$$$", O_CREAT | O_TEXT | O_APPEND)) == -1)
{
perror("Error:");
return 1;
}
write(handle, msg, strlen(msg));
printf("The file pointer is at byte %ld\n", tell(handle));
close(handle);
return 0;
}
函数名: textattr
功能: 设置文本属性
用法: void textattr(int attribute);
程序例:
#include
int main(void)
{
int i;
clrscr();
for (i=0; i<9; i++)
{
textattr(i + ((i+1) << 4));
cprintf("This is a test\r\n");
}
return 0;
}

你可能感兴趣的:(函数,职场,C语言,大全,休闲)