On Fri, 01 Jul 2011 14:53:45 +0300 Nikos Chantziaras <rea...@arcor.de> wrote:
> > You can alias them with a char* (a char pointer can alias everything in > a valid and defined manner). What you do is use the char* to scan over > the target type. And since a char is always guaranteed to be 8 bits, > it's very suited for doing endian conversions. > Yes, that's true, but in my case another concern was having data that is more easily human readable. A text file full of single-byte data is harder to read than a file with full 64 or 32 bit strings. For endian conversions, though, the char pointer is recommended. But with the availability of the "-fno-strict-aliasing" option it doesn't seem to matter which method is chosen.