B
Bo Sun
hi:
please take a look at the following code fragment:
class Test{
public:
static int i;
Test() {i = 33;}
};
int main()
{
int Test::i = 40;
return 0;
}
I am wondering, as to static members, why I cannot assign it values inside
main function? does this mean that I cannot assign static member values
anywhere inside a function?
thanks,
bo
please take a look at the following code fragment:
class Test{
public:
static int i;
Test() {i = 33;}
};
int main()
{
int Test::i = 40;
return 0;
}
I am wondering, as to static members, why I cannot assign it values inside
main function? does this mean that I cannot assign static member values
anywhere inside a function?
thanks,
bo