main(){ FILE *fpt; char a[]="hello world!";fpt = fopen("wendangming.txt","w");//创建并打开文档,并得到文件句柄fprintf(fpt,"%s",a); //通过文件句柄写入内容fclose(fpt); //关闭文件}