What is wrong in the following code? #include using namespace std; class Base { public: virtual void Method() = 0 { n = 1; } private: int n; }; class D1 :Base {}; class D2 :public D1 { int i
2/25
What is wrong in the following code? #include using namespace std; class Base { public: virtual void Method() = 0 { n = 1; } private: int n; }; class D1 :Base {}; class D2 :public D1 { int i; void Method() { i = 2; } }; int main() { D2 test; return 0; }
There is no error
There is a syntax error in the declaration of “Method”