
static member variable inside class
Please note that static data members must be initialized at file scope.
class Foo
{
private:
static int nTest;
Quote:
}
int Foo::nTest = 1; // the static member should be initialized at file
scope. Otherwise, you get a lnk2002 complaint.
Enter "static" for more related information in MSDN.
-Allen
Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights.