一些实用源代码
谢谢楼主了 应该说明是用来做什么的哦。 哈哈!下载看过程序了! 谢谢楼主了 <p>谢谢了</p> 介绍下呀! <p>什么代码?LZ介绍一下。。。。</p> 先下载了!呵呵,也不知道是什么东西应该是好用的啦!呵呵! #include "stdio.h"
void main()
{
FILE *funny,*printer;
char c;
funny = fopen("TENLINES.TXT","r"); /*打开文本文件 */
printer = fopen("PRN","w"); /*开启打印机*/
if(funny == NULL)
{ /*打开文本文件失败 */
printf("file tenlins.txt not found!\n");
exit(0);//退出程序
}
if(printer==NULL)
{ //打印机开启失败
printf("PRINTER not found!\n");
exit(0);//退出程序
}
do{
c = getc(funny); /* 从文件中得到一个字符 */
if(c != EOF)
{
putchar(c); //屏幕上显示字符
putc(c,printer); // 打印机上打印字符
}
}while (c != EOF); /*重复直到 EOF (end of file) */
fclose(funny);
fclose(printer); //关闭打印机
}
,其中部分…………参考一下……