fputs的使用
#include<stdio.h>
int main(int argc,char *argv[])
{
//1.打开文件
FILE *fp = fopen(argv[1],"w");
//2.fputs()写入文件
char *p[] ={ "hello\n","mike\n","lili\n"};
int i = 0;
int n = sizeof(p)/sizeof(p[0]);
for (i = 0;i < n; i++)
{
fputs(p[i],fp);
}
//3.关闭文件
fclose(fp);
}