09-03-2009
84,
0
Join Date: Sep 2009
Last Activity: 9 September 2018, 5:55 AM EDT
Location: Bangalore, India
Posts: 84
Thanks Given: 5
Thanked 0 Times in 0 Posts
Thanks for the assistance.
While interpreting the numerical values in the parser code, the parser does something like this :-
1. Reads 2048 bytes and stores in a char* buffer.
2. Then, reads an "int" like this :
int count = *(buffer + 8);
So, to take care of the endianness, should I swap four bytes first i.e. swap based on the sizeof(datatype) and then assign the value to the variable ? Will this suffice for endian-ness ?