S
subramanian100in
consider the following program:
class Test
{
public:
static Test i;
static double d;
int x;
};
Test t;
int main()
{
return 0;
}
This program compiles fine with both g++ and VC++ 2005 Express
Edition. Since I have not used the static data members I do not get
compilation error. My question is, why the compiler doesn't give an
error for not defining the static data members ?
Kindly explain.
Thanks
V.Subramanian
class Test
{
public:
static Test i;
static double d;
int x;
};
Test t;
int main()
{
return 0;
}
This program compiles fine with both g++ and VC++ 2005 Express
Edition. Since I have not used the static data members I do not get
compilation error. My question is, why the compiler doesn't give an
error for not defining the static data members ?
Kindly explain.
Thanks
V.Subramanian