class Test
{
private:
static int i;
public:
static void foo()
{
i = 10;
}
static int geti(){ return i; }
};
int _tmain(int argc, _TCHAR* argv[])
{
Test::foo();
std::cout << Test::geti();
return 0;
}
This is a simple test, I think I am wrong about static use in my program. Because I always get "Unresolved external symbol i". Why is this ?