How are function parameters performed?

Possible duplicate:
order of estimation of function parameters

Assuming I have a function with 4 arguments. Which parameter is considered the first to be executed and why.

I tried to understand the meaning of the operator ,used to prototype the function. Is this usually the last variable to be considered?

+3
source share
2 answers

If we have a function with the following prototype:

int function(int x, int y, int z);

And we call it that:

function( something_a(), something_b(), something_c() );

We have no way of specifying an execution order something_a, something_band something_c.

On the other hand, we can use the comma operator as follows:

int main() {
    int x;
    something_a(), something_b();
    something_c();
}

In this case, we know what will be called something_a, then, something_band finally something_c.

, , , .

+5
  • . .

  • , . , , .

+1

All Articles