In C and C++ what do the following declarations do?
const int * i;
int * const i;
const volatile int ip;
const int *i;
Are any of the above
You read variables declarations in C/C++ right-to-left, so to speak.
const int *i; // pointer to a constant int (the integer value doesn't change)
int *const i; // constant pointer to an int (what i points to doesn't change)
const volatile int ip; // a constant integer whose value will never be cached by the system
They each have their own purposes. Any C++ textbook or half decent resource will have explanations of each.