This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

this is non portable code ?


unsigned char buf[100]
.
.
.
unsigned int val;
.
.
.
val = *((unsigned int *)(&buf[1]));
.
.
.

comments?

Parents
  • 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

Reply
  • 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

Children
No data