Re: [Dev-C++] default arguments of a function
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-04-16 17:53:22
|
Sorry, but no.
/Per W
On Wed, 16 Apr 2003, Andr=E9 Mac=E1rio Barros wrote:
> Please consider the following code:
>
> #include <blahlib>
> #include <iostream>
> using std::cout;
> using std::endl;
>
> int func(int a=3D1, int b=3D2, int c=3D3);
>
> int main()
> {
> int x=3D10, y=3D20, z=3D30;
>
> 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 thr=
ee
> 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=3D3 and b=3D2;
> 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 p=
ass
> x and y to b and c?
>
> Regards
> Andre
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|