0
How are default arguments assigned when passing parameter values to a multiple-parameter function?
Say for example my function takes the form of int myFunc(int x=1, int y=1, int z=1). If in the main function I were to use the following myFunc(0,1), are the passed arguments automatically assigned to x and y? And what if I were wanting to pass these values to say y and z instead?
1 Antwort
0
Yes, if you use myFunc(0,1) in your main function the values 0 ans 1 will be assigned to variable x and y respectively while the value of z will be set to 1 by default.