Original Post
I'm new to C++ so I'm not sure if what I'm doing is the flat out wrong way of doing this or not. I made a header file that contains all of the code that generates a map for my game. Here are the first few lines...
[[MapGen.h]]
void MapGen()
{
int MapSize = 0;
int * P_MapSize = &MapSize
int MapSize_ResourceVar = 0; In my main chunk of code for the game, I have this (.cpp file): #include "MapGen.h"
...
void Population_Start()
{
MapGen ();
int Lands = 0;
int Population = 0;
Lands = &MapSize / 4;
Population = Lands; //grr... define lands in MapGen(). Need pointers to work :)
int Gold = 100;
int * P_Gold = &Gold
} Why is the compiler telling me that &MapSize is undefined? As you can probably guess, it does the same thing for &Gold in other functions etc.