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.
私のソフトウェアは、ファイルを読み込んでデバイスに書き込む必要があります。ファイルを最大サイズ (たとえば M バイト) の小さなページに分割し、各サイクルのページ アドレスも設定する必要があります。Cでどのように実装できますか?
ありがとう!
ヘティ
このデータで何をするかは明確ではありませんが、使用する必要があるチャンクごとにファイルを読み取るには、次のようにしますfread。
fread
FILE *file = fopen("yourfile.dat", "rb"); size_t amount; unsigned char buffer[PAGE_SIZE]; while ((amount = fread(buffer, 1, PAGE_SIZE, file)) > 0) { .. }