1int x = 5;
2int *p = &x;
3
4x = x + 4;
5x = *p + 4;
6*p = *p + 4;
7
8cout << x; //Output is 17
1int number;
2int value;
3int * pNumber;
4
5number = 5;
6pNumber = &number;
7
8assert(pNumber); // check before dereferenceing to prevent errors
9value = *pNumber // Use * to dereference the pointer
1int variable = 10;
2int *pointer = &variable; // Use & to get pointer of variable
3
4value = *pointer; // Use * to dereference the pointer
5// value should equal 10