#include<iostream>
using namespace std;
int main()
{
int* p=new int[2];
p[0]=1;
p[1]=2;
cout<<p[0]<<" "<<&p[0]<<endl;
cout<<p[1]<<" "<<&p[1]<<endl;
cout<<endl;
cout<<*p<<" "<<p<<endl;
p++;
cout<<*p<<" "<<p<<endl;
delete [] p;
}
the output of the above program is :
1 0xe502f0
2 0xe502f4
1 0xe502f0
2 0xe502f4
aborted(core dumped)
can anyone pls tell me why the program gives an aborted error...