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;
}
Wall Street scales fresh highs on tech earnings, US-China trade optimism
-
Wall Street indexes reached record highs for a second day, fueled by
optimism for a U.S.-China trade deal and anticipation of tech earnings and
an expected...
2 hours ago

No comments:
Post a Comment