Please consider the following code:
#include <blahlib>
#include <iostream>
using std::cout;
using std::endl;
int func(int a=1, int b=2, int c=3);
int main()
{
int x=10, y=20, z=30;
blah blah blah code;
cout << func(x,y,z) << endl;
more blah, blah, blah code;
return 0;
}
int func(int a, int b, int c)
{
blah blah blah code;
return(some int);
}
A) If I call func without arguments, that is, func(), it will use the three
default arguments;
B) If I use func(x,y), it will consider c value equal to 3;
C) Idem for func(x), it will consider c=3 and b=2;
Allways considering the most right side of the arguments list as default
values;
-->My question:
Is there any way to express func call to say to it to use one or two
arguments to specific
parameter, that is, something like func(,y,z) to express that I want to pass
x and y to b and c?
Regards
Andre
|