I am new in c++ i have a question on default argument.
If there a function with a following prototype
void f(int=10,int=20,int=30,int=40)
If this funcion is called by passing 2 arguments to it,how can we make sure that these argumnts are treated as first and third whereas, the second and forth are taken as defaults.
You can’t. Arguments to functions match the parameters in order. You can use overloading instead of default arguments like this: