Hello, I have a question, when does a global variable get destructed?
ex.
#include <iostream>
using namespace std;
class simple {
public:
int *i;
simple(int ni){
i = new int(ni);
}
~simple(){
delete i;
}
}
simple simple1(10);
//for simplicity no command line
int main(){
cout<<*(simple.i)
}
when will simple::~simple() be called? after the execution of main finishes?