#include <iostream>
using std::cout;
using std::endl;
class monster {
public:
int x, y;
float health;
bool alive;
};
class boss {
public:
int x, y;
float health;
bool alive;
int gold_drop;
};
typedef struct _uber_awesome_advanced_memory_simulating_struct_close_enough {
monster m;
boss b;
monster* get_mp () {return &m;}
boss* get_bp () {return &b;}
} uber;
int main () {
uber ub;
monster *m = ub.get_mp();
boss *b = ub.get_bp();
cout<<"m "<<m<<endl;
cout<<"b "<<b<<endl;
b->x = b->y = 123;
m->x = m->y = 900;
monster* bad_pointer;
bad_pointer = m;
cout<<"bad_p1 "<<bad_pointer<<endl;
cout<<"OOOPS bad pointer management"<<endl;
bad_pointer += 0x1;
cout<<"bad_p2 "<<bad_pointer<<"\n\n"<<endl;
cout<<"What is the MONSTER position?: ["<<bad_pointer->x<<", "<<bad_pointer->y
<<"] ... WHAT?\n";
cout<<"wait... wait... what? I'm out of here.";
}