/** Demonstrate basic pointer usage. */ #include using namespace std; int main() { int a; // a is an integer int *aPtr = nullptr; // aPtr is a pointer to an integer a = 7; // give a a value aPtr = &a; // set aPtr to the address of a cout << "The value of a is: " << a << endl << "The address of a is: " << &a << endl << "The value of aPtr is: " << aPtr << endl; cout << endl; cout << "The value of a is: " << a << endl << "The value of *aPtr is: " << *aPtr << endl; cout << endl; cout << "Showing that * and & are inverses of each other:" << endl << "&*aPtr = " << &*aPtr << endl << "*&aPtr = " << *&aPtr << endl; return 0; }