#include <iostream>
usingnamespace std;
template<class T>
class class0 {
protected:
staticconstint p =300;
public:
char getChar();
};
template<class T>
class class1:public class0<T> {
public:
void printChar();
};
template<class T>
void class1<T>::printChar(){
cout<< p<<endl;//p was not declared in this scope
}
int main()
{
cout << "Hello world!" << endl;
return 0;
}
C:\Users\NARENDRA\Desktop\pointers lab\template inheritance\main.cpp||In member function 'void class1<T>::printChar()':|
C:\Users\NARENDRA\Desktop\pointers lab\template inheritance\main.cpp|21|error: 'p' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|