#include <stdio.h>
int main(void)
{
FILE* fp = NULL;
fp = fopen("abc.txt","a+"); //fopen(path, mode) 以“mode”的方式打來文件abc.txt
if (NULL == fp)
{
printf("fopen fail\r\n");
perror("");
}
else
{
fwrite("hello filestream!", 1, 17, fp); //fwrite(const char* string, size_t size, size_t nmem, fp)將string指向的字符串寫到fp指向的文件中,單個寫入內容大小爲size,總共nmem個size大寫的內容寫入
fclose(fp);
}
return 0;
}