#include using namespace std; int main() { int num; int *ptr; num = 5; ptr = # // ptr contains the address of num; cout << "the value of num is " << num << endl; cout << "the address of num in memory is " << ptr << endl; cout << *ptr << endl; // displaying the value of memory location pointed by ptr. // this value must be the same as the value num since // the same memory location is displayed cout << endl; int *p = new int; *p = 4.5; cout << p << endl; // displaying a dynamically allocated memory address. It is quite // different than the address stored in ptr. The reason is that // variables are allocated from a different portion of memory return 0; }