#include <stdio.h>
int main(void)
{
FILE *f = fopen("E:\\test.txt","w");
fputc('A',f);
fputs("Hello wrold!",f);
fclose(f);
return 0;
}
C语言之读取文件内容
#include <stdio.h>
int main(void)
{
char a;
char s[15];
FILE *f = fopen("E:\\test.txt","r");
a=fgetc(f);
fgets(s,14,f);
fclose(f);
printf("%c",a);
printf(s);
return 0;
}