Order of function parameter execution

suggest change

The evaluations of function arguments are unsequenced. Either argument may be evaluated first, and a program must not rely on an order. The call below also modifies a twice with no intervening sequence point, which is undefined behavior, not merely an unspecified order. Do not treat a particular printed result as portable.

#include <stdio.h>

void function(int a, int b) 
{
    printf("%d %d\n", a, b);
}

int main(void)
{
    int a = 1;
    function(a++, ++a);
    return 0;
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents