【C++】STL(Standard Template Library)相談室 4at TECH
【C++】STL(Standard Template Library)相談室 4 - 暇つぶし2ch302:デフォルトの名無しさん
05/11/24 18:25:52
ofstream ofs("output", ios::out | ios::binary);
list<int> mylist;
for (int i = 0; i < 10; i++)
mylist.push_back(i);
copy(list.begin(), list.end(), ostream_iterator<int>(ofs));

これで
00 00 00 00 01 00 00 00 02 00 00 00...というバイナリファイルが出来るという
わたしの願いは裏切られ、0123456789というテキストファイルが出来た。
なぜだろうね?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch