Question #236108

What problem may arise with the following functions in a program ? Explain.

int fun();

Int fun(int x=0 ,int y=0);


Expert's answer

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.


LATEST TUTORIALS
APPROVED BY CLIENTS