Calculation based on pointer : int pointer « Data Types « C++ Tutorial






#include <iostream> 
using namespace std; 
 
int main() 
{ 
  int *p, num; 
 
  p = &num; 
 
  *p = 100; 
  cout << num << ' '; 
  (*p)++; 
  cout << num << ' '; 
  (*p)--; 
  cout << num << '\n'; 
 
  return 0; 
}
100 101 100








2.3.int pointer
2.3.1.Using int pointers
2.3.2.Get address of an int variable
2.3.3.Calculation based on pointer