typedef unsigned char Byte; ... void ReverseBytes( void *start, int size ) { Byte *buffer = (Byte *)(start); for( int i = 0; i < size / 2; i++ ) {
If you need to reverse there is a chance that you can improve your algorithms and just use reverse iterators.