SQLite Forum

Endianness help
Login
Now we are getting down to the nitty gritty and I thank you all for that.

When I first looked at endianness I imagined the bits in a byte being numbered from 0 on the left to 7 on the right (not that the direction mattered) and that was the way they'd be stored in memory or any external device. I saw it the following way

uint16_t x = 1 + (2 << 8);

On a little endian system the 'bulbs' in x and x+1 would look like

10000000 01000000

and on a big endian system as

01000000 10000000

which differ only in the order of the bytes. That linux article turned that thinking on its head and is the source of my confusion. Can you guys confirm I was on the right track originally and we can all get our lives back.

PS Got to say that little endianness is by far the less confusing when thinking 'bulbs'.