dimanche 27 octobre 2019

why exception thrown(read access violation) when cout NULL pointer? in c++

As NULL pointer assignes zero to its value. 1.When i try to cout null pointer it shows exception why is that? It is not outputing zero . 2. My second question is ,does the value zero has any address? Example code :

int main()

{

int *q = NULL;

cout << *q;

return 0;

}

Aucun commentaire:

Enregistrer un commentaire