M
Madhav
hi all,
I was trying the following code on the MS .net compiler:
class Item {
static int count;
public:
//static void init() { }
Item()
{
count++;
cout<<"constructing Item"<<endl;
}
~Item()
{
count--;
cout<<"Destroying Item #"<<count<<endl;
}
};
The compiler kept giving me error for the unresloved symbol count.
After that , I made the variable count public and tried to assign 0 to
it in the main function. But still the same error was reported by the
compiler. I am confused about why the error has occured.
Thanks,
Madhav.
I was trying the following code on the MS .net compiler:
class Item {
static int count;
public:
//static void init() { }
Item()
{
count++;
cout<<"constructing Item"<<endl;
}
~Item()
{
count--;
cout<<"Destroying Item #"<<count<<endl;
}
};
The compiler kept giving me error for the unresloved symbol count.
After that , I made the variable count public and tried to assign 0 to
it in the main function. But still the same error was reported by the
compiler. I am confused about why the error has occured.
Thanks,
Madhav.