Doubt in pointer

int a=10;
int *p=&a;
cout<<*p;

This code gives me correct output but

int a=10;
int *p;
*p=&a;
cout<<*p;

this code gives me error

hi @rathidevesh906_1dcc73a061c159bb write p = &a

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.