I am a high school student currently learning C++.So while doing pointers I came across a problem,
When I try to display the value at y,it shows:
The value of x is displayed properly,but after I write *y as *(x+1),it works fine
Can any one please explain why I am getting a segmentation fault?
Despite the what the screenshots show,all the code compiled perfectly.