Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ベース256の整数としてバイトの配列があります。したがって、[0、120、255、30、21]のようになります。各数値はバイトを表すため、0 = 0000000、1 = 0000001、2 = 00000010 などのように...
この配列をファイルに書き込むにはどうすればよいですか? 私は本当に迷子になっています。どこから始めればいいのかわからないのです。
簡単な例を次に示します。
#include <fstream.h> char buffer[100] = {0, 120, 255, 30, 21, ... }; ofstream myFile ("data.bin", ios::out | ios::binary); myFile.write (buffer, 100);