B
Bob Altman
I'm obviously doing something dumb, but for the life of me I can't figure it
out. Why does the following unmanaged C++ code fail to link with an
unresolved reference to the static variable "x"?
class TestClass
{
private:
static int x;
public:
static int Test()
{
x = 5;
return x;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
int t = TestClass::Test();
return 0;
}
out. Why does the following unmanaged C++ code fail to link with an
unresolved reference to the static variable "x"?
class TestClass
{
private:
static int x;
public:
static int Test()
{
x = 5;
return x;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
int t = TestClass::Test();
return 0;
}