#include<bits/stdc++.h>
using namespace std;
int main(){
int x;
int *y;
x=2;
y= &x;
cout << y << endl;
cout << y[0] << endl; #this cout shows the value of x ( 2 at this case)
cout << y[1] << endl;
cout << y[2] << endl;
cout << y[3] << endl;
return 0;
}
When I Try to cout only the pointer it comes in ) 0x(hex value), and I was trying to get only the hex value of it, why is that happening?