I have the following code that I’m reading through:
if( (i%2) == 0 ){
*d = ((b & 0x0F) << 4);
}
else{
*d++ |= (b & 0x0F);
};
I’m looking specifically at the else statement and wondering in what order this occurs? I don’t have a regular C compiler, so I can’t test this. When we are performing *d++ |= (b & 0x0F);, what order does this occur in?
The ++ is applied on the pointer
d, not on the lvalue that is being assigned to,*d.If you really want to, you can think of it like this:
bis bitwise-AND:ed with the constant0x0fdpoints at.dis incremented to point at the next value.