Program 1:
#include <iostream>
using namespace std;
int main ()
{
int *ptr = NULL;
cout << "The value of ptr is " << ptr ;
return 0;
}
Program 2:
#include <iostream>
using namespace std;
int main ()
{
char *ptr = NULL;
cout << "The value of ptr is " << ptr ;
return 0;
}
The question is,In the Program 1 the output is stable as :
The value of ptr is 00000000
while,in the Program 2,instead of int pointer I used char pointer and it gives me an Exception.
can anyone help me with the understanding?