mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-04 11:03:58 +08:00
support bazel complie this project and format code.
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Derived;
|
||||
class Derived;
|
||||
|
||||
class Base {
|
||||
public:
|
||||
virtual void fun() { cout << "Base Fun"; }
|
||||
// friend int main();
|
||||
};
|
||||
class Base {
|
||||
public:
|
||||
virtual void fun() { cout << "Base Fun"; }
|
||||
// friend int main();
|
||||
};
|
||||
|
||||
class Derived: public Base {
|
||||
private:
|
||||
void fun() { cout << "Derived Fun"; }
|
||||
};
|
||||
class Derived : public Base {
|
||||
private:
|
||||
void fun() { cout << "Derived Fun"; }
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
Base *ptr = new Derived;
|
||||
ptr->fun();
|
||||
return 0;
|
||||
int main() {
|
||||
Base *ptr = new Derived;
|
||||
ptr->fun();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user