Possible Duplicate:
What is the difference between const int*, const int * const, and int const *?
I know two variations of pointer variables in C++.
Say I have
mystruct{
int num;
}
Variation 1:
const mystruct* m1;
means the member variables in m1 can not be altered, for instance, m1->num = 2
would produce an error.
Variation 2:
mystruct *const m2 = m1;
means once m2 is set to point to m1, an error would be produced if you subsequently set m2 =m3
.
However, there seems to be a third variation, that I am not certain the property of:
Variation 3:
mystruct const * m3;
What does this mean?