how can i use a vector in multiple .cpp and header files simultanously?
<p>i have a main.cpp and some classes which each of them is defined in two files: a header and a .cpp file.
in the main.cpp i have a 2d vector. I want to use this vector in the member functions of the classes.first i tried to include the main file, but i received the redefinition Error. after that i tried to define the vector in another .h file. but that didn't work either.
so what should i do to use this vector in the defining of some classes, in that way that it could save the changes which member functions made.  </p>

<p>unfortunately the vector is global!</p>

<p>for more information this vector is board of a game. this game has some objects: a monster, a human, a treasure and some traps. 
the board is defined global before the main function. there are some functions in main.cpp that use this board, and classes which i mentioned 3 lines above, use this board in their member functions.</p>

<p>is solution using 'extern'?(i don't know what it is, i just saw it in answers!-if it's the solution, i should search about it.)</p>
