int numArr[] = {1, 2, 3, 4, 5};
int *ptrArray = &numArr[2];
// assign the address of the numArr index 2 to ptrArray pointer
cout << *ptrArray << endl; //display the value in index 2, which is 3
cout << ptrArray[2] << endl; //display the value in index 4, which is 5
//ptrArray[2] is equivalent to *(ptrArray + 2)
cout << *ptrArray << endl; // display the value in index 2, which is 3
ptrArray = &ptrArray[2]; //will add 2 to the index
cout << *ptrArray << endl; // display the value in index 4, which is 5