What is wrong in that: I just wanted to pointers to int and give that ints value of 0.
int* p;int* q;
*p = 0; *q = 0;
cout<<"p = "<<*p<<" q = "<<*q<<endl;
This is annoying
WORKS:
int* p;
*p = 0;
cout<<*p<<endl;
CRASHES:
int* p;
int* q;
*p = 0;
*q = 0;
cout<<*p<<endl;
To use a pointer, that pointer has to point to something. So there are two steps: create the pointer, and create the thing it points to.