C++ Institute C++ Certified Professional Programmer CPP Question # 47 Topic 5 Discussion

C++ Institute C++ Certified Professional Programmer CPP Question # 47 Topic 5 Discussion

CPP Exam Topic 5 Question 47 Discussion:
Question #: 47
Topic #: 5

What happens when you attempt to compile and run the following code?

#include

using namespace std;

template

void f(A &a)

{

cout<<1<

}

void f(int &a)

{

cout<<2<

}

int main()

{

int a = 1;

f(a);

return 0;

}


A.

program displays: 1


B.

program displays: 2


C.

compilation error


D.

runtime exception


Get Premium CPP Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.