+ 5

About default arguments

How can just the last argument be default when the function has 3 arguments??

25th Apr 2017, 7:16 AM
Ehsan Alizadeh
Ehsan Alizadeh - avatar
4 Antworten
+ 7
@Toky R. Integer c is default argument.
25th Apr 2017, 7:26 AM
Nithiwat
Nithiwat - avatar
+ 4
example : void myFunction(int a, int b, int c = 0)
25th Apr 2017, 7:23 AM
Toky R.
Toky R. - avatar
+ 3
No! I mean all have default values but i just wanna return the last one.
25th Apr 2017, 9:04 AM
Ehsan Alizadeh
Ehsan Alizadeh - avatar
+ 3
I don't understand...
25th Apr 2017, 9:58 AM
Toky R.
Toky R. - avatar