1.

What is the output of this program?
#include <iostream>
using namespace std;
template <class T>
class N
{
public:
N(int p): q(p) {}
protected:
int q;
};
template <class T>
class M: public N<char>
{
public:
M(): N<char>::N(50)
{
cout << q * 3 << endl;
}
};
int main()
{
M<char> test;
return 0;
}

A. 50
B. 150
C. Compilation Error
D. Runtime Error
E. None of these
Answer» C. Compilation Error


Discussion

No Comment Found

Related MCQs