Find Output Q.12

0. What is the output of the following c++ program?
void abc (int x = 0, int y = 0)
{
cout << "Hi There";
}
void abc (int x)
{
cout  << "How are you doing today ? " ;
}
void main (void)
(
int m = 5;
abc (m) ;
}    

  • Option : D
  • Explanation : The call abc ( ) matches with the signatures - void abc (int x = 0, int y = 0) and void abc (int x). The compiler cannot unambiguously resolve this conflict. So it complains.
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 *