I have done overloading for new, I'm shocked to see how come my Dev CPP compiler didn't give any error when I have assigned a void * to A *. I'm wondering whether the compiler is doing the required things here, Am I right ?. Thanks in advance.
class A {
public:
void* operator new(size_t size)
{
return malloc(size);
}
};
int main(int argc, char** argv) {
A* a = new A();
void* v = NULL;
return 0 ;
}