[問題] ofstream的輸出方式

看板C_and_CPP (C/C++)作者 (岳岳)時間14年前 (2011/10/14 19:55), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Dev-C++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) no 問題(Question): 因為在做壓縮方面題目,想請問各位先進 ofstream在寫出檔案時,是否與要輸出的資料相同 ex: ofstream output; 若有int a;char b; output<<a; //寫出的大小是與int一樣4byte嗎 output<<b; //寫出的大小是與char一樣的1byte嗎 補充說明(Supplement): 在此先感謝回答的先進 -- ※ 發信站 :批踢踢實業坊(ptt.cc) ◆ From: 140.112.243.202

10/14 19:58, , 2F
www.cplusplus.com/reference/iostream/ostream/write/
10/14 19:58, 2F

10/14 20:00, , 3F
感謝,讀一下
10/14 20:00, 3F

10/14 20:06, , 4F
了解了
10/14 20:06, 4F
文章代碼(AID): #1Ec2CoBn (C_and_CPP)
文章代碼(AID): #1Ec2CoBn (C_and_CPP)