Displaying 1 result from an estimated 1 matches for "revarray".
2003 Jun 13
2
Trouble decoding number of codebooks
...readBytes(file,2);
int codebookDimensions = (int)convertArray2(dimensions, 2);
//read codebook entries
unsigned char *entries = readBytes(file,3);
long codebookEntries = convertArray2(entries,3);
}
long convertArray2(unsigned char *array, int size)
{
//reverse the array
unsigned char revArray[size];
for(int i = size - 1; i >= 0; i--)
revArray[(size-1) - i] = array[i];
//return a pointer to a long
long *result = (long *)revArray;
return *result;
}
The results that I get from the code are :
Sync Pattern (starting byte #269) : 42 43 56 (outputed as integers)
Codebook...