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.

Comments

Popular posts from this blog