I'm supposed to make a class which has a static vector as a variable.
using namespace std;
class Foo
{
public:
static vector<Player> PLAYERS;
};
In the .cpp file I got an undefined reference to the vector and I have been told I have to declare it first
vector<Player> Foo::PLAYERS;
My question is what does that declaration excactly do? Is it similar to the constructor of a class? If the vector wasn't static would I still have to declare it?