結構體數組 fwrite 寫入文件,記事本打開亂碼,寫字板正常顯示。
fwrite
fwrite(&s[i], sizeof(struct st), 1, fp)
用十六進制編輯器打開文件,可見字符串字段(如 41 42 43 = "ABC")夾雜 00 填充字節。
41 42 43
00
若需人類可讀,改用 fprintf(fp, "%s %s %s\n", name, age, tel) 文本格式寫入;二進制僅供程序讀取。
fprintf(fp, "%s %s %s\n", name, age, tel)
代碼 new ArrayList<DeviceSett
現象 Set<String> set = new
錯誤現象 使用 res.sendFile(./downloa
現象 函數參數類型為 const char*,傳入 QByt