PROGRAMMING SAMPLE 1 (array and pointer)
// C++ Program to display address of each element of an array
cout << "Displaying address using arrays: " << endl;
for (int i = 0; i < 3; ++i)
cout << "&arr[" << i << "] = " << &arr[i] << endl;
cout<<"\nDisplaying address using pointers: "<< endl;
for (int i = 0; i < 3; ++i)
cout << "ptr + " << i << " = "<< ptr + i << endl;