unsigned char buf[100] . . . unsigned int val; . . . val = *((unsigned int *)(&buf[1])); . . .
comments?
Unfortunately, it may rely upon false assumptions - and it might only work by pure luck!
True - But someone who builds up experience of such things can learn to more reliably determine the risk.
Just to follow on from my previous - Through experience I have determined that I don't have to put on my wellington boots before getting out of bed.
I would prefer to consider it a calculated risk.
I would not consider it wrong - I might, possibly, change my mind if I were to get my feet wet one morning ;)
True - But someone who builds up experience of such things can learn to more reliably determine the risk. there is nothing wrong with experience, if therte was, I would be up the creek re the '51 :)
Of course, were I to 'verify' my assumption that a char is 8 bits every time I type char, I would never get anywhere.
I can state my point in another way, which may be better: "when you see a bug, before anything else, verify the correctness of your assumptions"
Erik