//文件的打开,写入,关闭
#include <stdio.h>
int main()
{
char str[] = "Hello World!";
FILE * pFile = fopen("a.txt","w");
if (NULL != pFile)
{
int pos = 0;
while ('\0' != str[pos])
{
//int fputc(char ch,File *fp);
fputc(str[pos],pFile);
pos++;
}
fclose(pFile);
pFile = NULL;
}
return 0;
}
文件的打开、写入、关闭
最新推荐文章于 2024-03-10 20:25:10 发布