看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Linux 問題(Question): 基本上跟這位仁兄遇到的狀況一樣 http://bbs.csdn.net/topics/360066552 在 Win 7 用 fwprintf 寫檔沒問題, 同樣的 code 放在 Linux 上就不 work 了 餵入的資料(Input): //Header 預期的正確結果(Expected Output): 寫入檔案(以16進位表示) 2F 00 2F 00 48 00 65 00 61 00 64 00 65 00 72 00 錯誤結果(Wrong Output): 2F 2F 48 65 61 64 65 72 程式碼(Code):(請善用置底文網頁, 記得排版) FILE *fp = fopen(szFilename, "wb+"); fwprintf(fp, L"//Header\n"); fclose(fp); --  試了很久,找不出原因,在 google 上也找不到解法,  還是只能來求教全能的板友了... <(_ _)> -- I want you to join my army. === http://0rz.tw/V9OIa === -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.29.60 ※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1397639555.A.FC6.html
serikafan:locale問題, #include<locale.h> ,然後在程式開頭加上 04/16 19:37
serikafan:setlocale(LC_ALL,""); 就行了 04/16 19:38
archon:(筆記!!!) 04/16 20:59