E
entrepreneur
this is the code:
#include<iostream.h>
#include<string.h>
int count=0;
class obj{
public :
obj();
~obj();
};
obj() {
++count;
cout<<count<<endl;
}
~obj(){
--count; cout<<count<<endl;
}
int main(){
obj A;
cout<<"begin block "<<endl;
obj B;
cout<<"end block"<<endl;
return 0;
}
where is the error? can someone point it out for me?
your help will be greatly appreciated.
best regards.
#include<iostream.h>
#include<string.h>
int count=0;
class obj{
public :
obj();
~obj();
};
obj() {
++count;
cout<<count<<endl;
}
~obj(){
--count; cout<<count<<endl;
}
int main(){
obj A;
cout<<"begin block "<<endl;
obj B;
cout<<"end block"<<endl;
return 0;
}
where is the error? can someone point it out for me?
your help will be greatly appreciated.
best regards.