1. Modify member variables
int value=0;int *p=&value;const int *p_c=&value; the// pointer points to a constant , but the address pointed to by the pointer can be modified (int const *p_c=&value, also pointer to constant)int *const c_p=& Value The //(constant) pointer points to the variable , but the address pointed to by the pointer is constant and cannot be changed
2, modifier function parameters (often and references at the same time, improve the efficiency of the transfer, and make the parameters can not be changed by the algorithm in the function body).
3. Modify the member function.
Note: 1. You cannot modify member variables (unless you add the mutable keyword); 2. Non-const member functions cannot be called (normal member functions can modify member variables)
4, modify the ordinary variable (directly as a constant use, in place of the macro).
Usage of C + + const