Sphere: Related Content
#include <iostream>
using namespace std;
class Base{
public:
int basicF();
int virtual virtualF(){
cout << "hi this base virtual function" << endl;
return 0;
}
void virtual pureVirtualF() = 0;
};
class Derived : public Base{
public:
int virtual virtualF(){
cout << "hi this derived virtual function" << endl;
return 0;
}
void virtual pureVirtualF(){
cout << "This pure virtual function in Derived" << endl; }
};
#if 1
class Derived1 : public Derived {
public:
int virtual virtualF(){
cout << "hi this derived1 virtual function" << endl;
return 0;
}
};
#endif
int main(){
Base *p;
Derived d, *p1;
Derived1 d1;
#if 0
a.virtualF();
p = &a;
p->virtualF();
#endif
p = &d;
p->virtualF();
p->pureVirtualF();
p = &d1;
p->virtualF();
p1 = &d1;
p1->virtualF();
//p->pureVirtualF();
return 0;
}
TikTok to ‘Go Dark’ on Sunday for Its 170 Million American Users
-
The Chinese-owned company said it will cut off its services unless the U.S.
assures Apple, Google and other companies that they will not be punished
for ho...
48 minutes ago
No comments:
Post a Comment