| 1234567891011121314151617181920 |
- #include <iostream>
- using namespace std;
- int main()
- {
- int n = 5;
- cout << &n << endl;
- int *ptr = &n;
- cout << ptr << endl;
- cout << *ptr << endl;
- *ptr = 10;
- cout << ptr << endl;
- cout << *ptr << endl;
- // the value of n also changed
- cout << n << endl;
- return 0;
- }
|