Null pointer in c++
#include<iostream> using namespace std; class A { public : void print() { cout<<"Hello"; } }; int main() { A * a=new A(); A* b = NULL; a->print(); b->print(); }
Explain the o/p and reason behind it.
#include<iostream> using namespace std; class A { public : void print() { cout<<"Hello"; } }; int main() { A * a=new A(); A* b = NULL; a->print(); b->print(); }
Explain the o/p and reason behind it.
Comments
Post a Comment