Doubt in formal param

void subsequence(string s,string out,int i=0,vector &v)

Why the above statement raises error -> default parameters missing for -> v ?

hi… pls share ur code…

@Vaibhav277

I don’t have that now ! I deleted my code…though I removed this error but was not sure about the reason of error in first place,

I basically replaced that with this
void subsequence(string s , string out , vector &v , int i=0)

this function basically pushes the subsets of a string s in vector v…also with this change my code worked fine (I tried all corner cases too)!

so basically u must not be passing value of i in function call… so all the default variable in function should be present at rightmost only… that why when u interchanged ur code worked…

@Vaibhav277
ohhk…got it !

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.