#define MIN(A,B) ((A) <= (B) ? (A) : (B))
This is a macro, I was asked what side effect I used:
least = MIN(*p++, b);
Note. It was related to the question.
It evaluates p++ twice. In addition, since the first estimate changes p , the second time it will point to another element . So the return value will be *(initialp + 1) or b .
p++
p
*(initialp + 1)
b
You have to try it yourself.
The macro will expand to:
least = ((*p++)<=(b)?(*p++):(b))
you will then have *p++ twice in your statement (i.e. it will double in size).
*p++
*p++ gets evaluated twice when the macro expands to *p++ <= b ? *p++ : b *p++ <= b ? *p++ : b
*p++ <= b ? *p++ : b
Also, there is no such thing as "embedded C".