I want to read sizeof(int) bytes from a char* array.
sizeof(int)
char*
a) In what scenario\'s do we need to worry if endianness needs to be checked?
Depends on how you want to read them, I get the feeling you want to cast 4 bytes into an integer, doing so over network streamed data will usually end up in something like this:
int foo = *(int*)(stream+offset_in_stream);