We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
unsigned char buf[100] . . . unsigned int val; . . . val = *((unsigned int *)(&buf[1])); . . .
comments?
But you - at least - have to verify it when you select a new processor or a new compiler. Of, course; however, I wrote "every time"
Luckily, no chip manufacturer dares to step away från n*8-sized integer data types, because of the very bad feedback they would get from all the people who made the incorrect assumption that their programs will not fail if run on a machine with a 7-bit or 9-bit char data type. If they do add unusual data types, they add them as complements to more standard data types. I would not know about chips, but Univac and (some) DEC machines use 6 bit bytes.
Erik
PS "från" slipped into your post, do you write in Swedish first or did a word just slip in ?
No two-step translation involved. However, I sometimes gets parity bit errors - especially when someone comes in and wants to talk to me in the middle of writing :)
Sw: från = Eng: from. They start the same, the same number of letters and similar pronounciation.
IBM had 36-bit big iron, so they impplemented 4x 9-bit characters or 5x 7-bit characters.
Control Data Corporation's "Cyber" machines used 6-bit characters and a 60-bit word. The OS had a special "ASCII" mode that translated files with special multi-byte escape sequences to represent both upper and lower case. Writing character values in octal actually made sense for this machine.