Hi All,
I got this code from a forum & tried it on g++/Linux.
In the code below i put NULL to a pointer variable but didnt get any errors.
#include <iostream>
using namespace std;
class A
{
private:
int _dmember;
public:
void func()
{
cout<<"Inside A!! "<<endl;
cout<<_dmember; //
}
};
int main ()
{
A *a=NULL;
a->func(); // prints "Inside A!!!"
return 1;
}
can someone please explain this to me ?