圧縮されたアーカイブ内のファイルの先頭にポインターを進める方法を探しています。
メモリに読み込まれたファイルの先頭への文字ポインタがあります。アーカイブ ディレクトリには、各ファイルのオフセットが含まれています。次のように言うことは合法/推奨されますか?
char* beginning; //Imagine this is assigned to the beginning of the file in memory
int file1OffsetBytes = 1000; // Imagine the first file is 1000 bytes into the file
char* file1 = beginning + file1OffsetBytes;
これは悪い考えですか?これを行う別の方法は何ですか?