나는 버퍼 (char *)를 통해 읽고 있는데, 나는 커서의 시작 위치를 추적하고 있는데, 버퍼에서 7-64 문자를 복사 할 수있는 방법이 있거나, 내 최선의 방법이다. poistion x에서 y 위치로 버퍼를 루프합니까? -char * 버퍼에서 y 위치의 x 문자를 읽는 방법?
int32_t size = this->getObjectSizeForMarker(cursor, length, buffer);
cursor = cursor + 8; //advance cursor past marker and size
char version[size] = this->getObjectForSizeAndCursor(size, cursor, buffer);
:
대상 버퍼의 크기는 다른 함수의 결과가 동적이
variable-sized object 'version' may not be initialized
관련 코드 부분을 반환 초기화
을 계산 33,210- 앞서 buffer
여섯 개 단위 포인터 (일곱 번째 인덱스에 도착하는)
int32_t FileReader::getObjectSizeForMarker(int cursor, int eof, char * buffer) {
//skip the marker and read next 4 byes
cursor = cursor + 4; //skip marker and read 4
unsigned char *ptr = (unsigned char *)buffer + cursor;
int32_t objSize = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
return objSize;
}
당신은 내가 멘토가 아닌 바로 그 것이다. –