add forward declaration examples
add class & inheritance examples
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "Entity.h"
|
||||
#include "Ork.h"
|
||||
#include "Vector3.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
Entity entity; // this is an entity instance
|
||||
entity.name = "My Entity";
|
||||
|
||||
//Monster monster; // can't be instantiated, because Monster is abstract
|
||||
|
||||
Ork ork;
|
||||
ork.name = "My Ork";
|
||||
ork.Move();
|
||||
|
||||
cout << entity.ToString() << endl;
|
||||
cout << ork.ToString() << endl;
|
||||
|
||||
Vector3 position(1.0f, 3.0f, -5.0f);
|
||||
position.y = 0.0f;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user