Hi fellows!
I am dealing with raw data and want to interpret data within an array differently.
Output: 153 instead of 41625.Code:unsigned char data[] = "\x99\xA2\x1E\x00\x6B\x00\xE4\x03\x00\x00\x00..." printf("%hu\n", (unsigned short)data[0]);
I thought I finally understood the fine things you can do with casting but in real I don't :S
So from the first 2 bytes of the byte array I want to get an unsigned short/word. The next data I interpret as raw byte data. Somewhere in the data I have strings and some integers also.
What am I doing wrong?



LinkBack URL
About LinkBacks





