Reputation: 1025
I have a function Func(string str,int*i=NULL,int*j=NULL,bool ok=false);
I called it as Func(some_string,false);
And program is crashing..Because the order I'm calling with --is wrong??
Upvotes: 2
Views: 190
Reputation: 1165
Yes. The second parameter is expecting a int value and you are passing a bool value. The 3rd and 4th parameters will take NULL and false respectively.
Upvotes: 0
Reputation: 500923
If you wish to specify a value for ok
, you also have to specify values for all arguments that precede it.
Upvotes: 2