Advertisement
Vita94

C++ Tutorial 11 - Pointers

Jul 8th, 2013
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int *p;
  7.     int n = 0;
  8.     p = &n;
  9.     cout << n << endl;
  10.     *p = 1;
  11.     cout << n << endl;
  12.     *p = *p + 10;
  13.     cout << n << endl;
  14.     (*p)++;
  15.     cout << n << endl;
  16.     system("pause");
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement