FILE* pFile;
pFile1 = fopen("e:\\last.txt","w+");
if (pFile1 == NULL)
{
return ;
}
fprintf(pFile1,"\r\n%s\r\n","-----------");
fclose(pFile1);
pFile1 = fopen("e:\\last.txt","w+");
if (pFile1 == NULL)
{
return ;
}
fprintf(pFile1,"\r\n%s\r\n","-----------");
fclose(pFile1);
本文展示了一个使用C语言进行文件操作的例子,包括文件的打开、写入和关闭过程。通过对一个具体文件last.txt的操作,演示了如何利用fopen、fprintf和fclose等函数实现文本文件的基本操作。
959

被折叠的 条评论
为什么被折叠?



