What will happen when you attempt to compile and run the following code?
#include
using namespace std;
template
class A {
T_v;
public:
A(T v): _v(v){}
T getV() { return _v; }
};
int main()
{
A a(1);
cout << a.getV() <return 0;} Aprogram will display:1 Bprogram will not compile Cprogram will compile Dprogram will cause runtime exception Show Suggested Answer Hide Answer Suggested Answer: B
return 0;
}
Limited Time Offer
25%
Off
Currently there are no comments in this discussion, be the first to comment!
Currently there are no comments in this discussion, be the first to comment!