#include
using namespace std;
int main()
{
int *ptr;
int x = 64;
//& is the memory address of the variable
ptr = &x;
cout << "ptr = " << ptr << endl;
cout << "x= " << x << endl;
cout << "&x = " << &x << endl;
cout << "*ptr = " << *ptr << endl;
return 0;
}
No comments:
Post a Comment