Hi
I am learning c++ pointers, I tried the following fragment:
and it gives:Code:int p1*; *p1=1; int p22=4; cout<<p22;
but when I added new int:Code:Segmentaiton fault (core dumped)
it works fine!!! is there anything I did not get about pointers causes this behavior???Code:int p1*; int y; *p1=1; int p22=4; cout<<p22;
Bookmarks