What problem may arise with the following functions in a program ? Explain.
int fun();
Int fun(int x=0 ,int y=0);
Compilation error might occur.
This is because all default arguments must be to rightmost arguments. If a default argument is parsed at the leftmost an error will occur.
Comments
Leave a comment