mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-10 22:16:31 +08:00
support bazel complie this project and format code.
This commit is contained in:
@@ -10,30 +10,25 @@
|
||||
* @version v1
|
||||
* @date 2019-07-24
|
||||
*/
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace std;
|
||||
|
||||
class base {
|
||||
public:
|
||||
base()
|
||||
{ cout<<"Constructing base \n"; }
|
||||
virtual ~base()
|
||||
{ cout<<"Destructing base \n"; }
|
||||
};
|
||||
class base {
|
||||
public:
|
||||
base() { cout << "Constructing base \n"; }
|
||||
virtual ~base() { cout << "Destructing base \n"; }
|
||||
};
|
||||
|
||||
class derived: public base {
|
||||
public:
|
||||
derived()
|
||||
{ cout<<"Constructing derived \n"; }
|
||||
~derived()
|
||||
{ cout<<"Destructing derived \n"; }
|
||||
};
|
||||
class derived : public base {
|
||||
public:
|
||||
derived() { cout << "Constructing derived \n"; }
|
||||
~derived() { cout << "Destructing derived \n"; }
|
||||
};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
derived *d = new derived();
|
||||
base *b = d;
|
||||
delete b;
|
||||
return 0;
|
||||
}
|
||||
int main(void) {
|
||||
derived *d = new derived();
|
||||
base *b = d;
|
||||
delete b;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user