C++ Institute C++ Certified Professional Programmer CPP Question # 62 Topic 7 Discussion

C++ Institute C++ Certified Professional Programmer CPP Question # 62 Topic 7 Discussion

CPP Exam Topic 7 Question 62 Discussion:
Question #: 62
Topic #: 7

What happens when you attempt to compile and run the following code? Choose all possible answers.

#include

using namespace std;

template

class A {

T_v;

public:

A() {}

A(T v): _v(v){}

friend ostream & operator<<(ostream & c, const A & v) {

c<

}

};

int main()

{

Aa(10);

cout<<a<

return 0;

}


A.

program will display:10


B.

program will not compile


C.

program will compile


D.

program will run without output


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.