Functions Q.3

0. A function abc is defined as
void abc(int x=0, int y, int z=0)
{

cout << x  << y << z;
}

Which of the following function calls is/are illegal? (Assume h, g are declared as integers) 

  • Option : D
  • Explanation : Since the second argument is mandatory, any call should have at least the first two parameters. Some compilers expect the optional parameters to follow the others. Such compilers give a compilation error.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *