// File: pointer1.cpp // // basic use of pointers #include using namespace std; int main() { int n ; // an int int *ptr ; // a pointer to int n = 3 ; ptr = &n ; // ptr has address of n cout << "n = " << *ptr << endl ; // use *ptr to get n *ptr = 7 ; // changes n cout << "n = " << n << endl ; // n is changed }