
writing to static class member variable...
Hi all,
I need to assign different values to a static variable of a
class. The following code do not work:
Set.h
class CSet
{
public:
......
static int count ;
protected:
........
Quote:
};
int CSet::count = 0; // Is this line neccessary??
CSetView.cpp
............
if ( type = = "DS")
CSet::count = 0;
.....
The error message i got was :
unresolved external symbol "public: static int CSet::count"
can someone tell me how to write to a static member?? I try declaring a
static member function and do the assignment inside it....and the same
problem still arise....i also try using friend static function and it
still won't work. btw, i am using VC++ 6.0
pls e-mail me in addition to the newsgroup.
Thanks in advance....
leesze
--
********************************************************
*As Imagination Bodies Forth
*The Forms Of Things Unknown, The Poet's Pen
*Turns Them To Shapes, And Gives To Airy Nothing
*A Local Habitation And A Name
*
********************************************************