我正在寻找一些方法来推进指向压缩档案中文件开头的指针。
我有一个指向已读入内存的文件开头的字符指针。存档目录包含每个文件的偏移量。是否合法/建议说:
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;
这是一个坏主意吗?还有什么方法可以做到这一点?