Dear Experts,
In the following Program
class A
{
public:
void print()
{
cout<<"Hello World"<<endl;
}
};
int main()
{
A *a;
(*a).print();
}
If we declare a class pointer which is uninitialized and we try to
call a member function (which is not accessing any data member of the
class) it works fine. Why?
Does standard allow this?
Regards,
Siddharth
In the following Program
class A
{
public:
void print()
{
cout<<"Hello World"<<endl;
}
};
int main()
{
A *a;
(*a).print();
}
If we declare a class pointer which is uninitialized and we try to
call a member function (which is not accessing any data member of the
class) it works fine. Why?
Does standard allow this?
Regards,
Siddharth
Comment