标签: c file file-io file-handling
我有两个字符串,我想以下列格式将这些字符串写入FILE:
string1 "space/comma" string2 "newline" string3 "space/comma" string4 "newline" .. .. ..
答案 0 :(得分:5)
FILE* fileptr = fopen("file.txt","wt"); fprintf(fileptr,"%s , %s \n",string1,string2);