This is a very similar problem to a question i have already looked at, answered here - Restarting a game and reinstantiate objects .
I want exactly the same thing except my problem is slightly different in that the object i wish to reinstantiate is 'global' and is only ever created when the program first runs.
At present i create the new 'Player' after my #includes and before my function prototypes ...
#include "Player.h"
#include "Monster.h"
using namespace std;
string MonsterTypes[3] = {"Orc","Goblin","Dark Rider"};
//create a stack of 'monsters'
stack<Monster>MonsterList;
Player* NewPlayer = new Player();
int NewGame();
void SetupPlayer();
void SetupMonsters();
void MainGame();
void Combat();
int GetMonstersLeft();
Do i need to create an entire factory class just to create a single player? Obviously when i call the function 'setupPlayer' i could create the player object in there, but would i not then have to pass 'NewPlayer' to every other function, i was just wandering if there was a way to avoid doing that?