mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-04-02 18:21:05 +08:00
support bazel complie this project and format code.
This commit is contained in:
@@ -7,24 +7,23 @@
|
||||
* @version v1
|
||||
* @date 2019-07-20
|
||||
*/
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Base {
|
||||
public:
|
||||
Base() { cout << "Constructor: Base" << endl; }
|
||||
virtual ~Base() { cout << "Destructor : Base" << endl; }
|
||||
class Base {
|
||||
public:
|
||||
Base() { cout << "Constructor: Base" << endl; }
|
||||
virtual ~Base() { cout << "Destructor : Base" << endl; }
|
||||
};
|
||||
|
||||
class Derived: public Base {
|
||||
public:
|
||||
Derived() { cout << "Constructor: Derived" << endl; }
|
||||
~Derived() { cout << "Destructor : Derived" << endl; }
|
||||
class Derived : public Base {
|
||||
public:
|
||||
Derived() { cout << "Constructor: Derived" << endl; }
|
||||
~Derived() { cout << "Destructor : Derived" << endl; }
|
||||
};
|
||||
|
||||
int main() {
|
||||
Base *Var = new Derived();
|
||||
delete Var;
|
||||
return 0;
|
||||
int main() {
|
||||
Base *Var = new Derived();
|
||||
delete Var;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user