I'm trying to figure out how class pointers work, here example code:
#include <iostream>
class A {
public:
void m(int x) {
std::cout << "hello " << x << std::endl;
}
};
int main() {
A *a = new A();
for (int i = 1; i < 9; ++i) { a->m(i); }
delete a;
a->m(123);
return 0;
}
Why a->m(123); works after delete a;?