previous | start | next

Argument Passing and Multiple Arguments

Argument passing method can be different for each argument in a function that has multiple parameters.

The function setBoth below sets a = x and b = y and guarantees that x and y are not changed!

What should its declaration be? That is, how should the 4 arguments be passed?

int main()
{
   int a = 5, b = 3;
   int x, y;
   x = a + b;
   y = a;

   setBoth(a, b, x, y);

}  


previous | start | next