C++ examples for Data Type:Pointer
Read the value of the original variable through the pointer.
#include <iostream> using namespace std; int main()//w ww .j a v a 2 s .c o m { int a = 10; int *ptr = &a; int backup; *ptr = 200; backup = *ptr; cout << backup << endl; *ptr = 7000; cout << *ptr << endl; cout << backup << endl; return 0; }