Position of const (C++)

“West-Const vs. East-Const”


West-Const (The common one)

int * num             = new int(42); // Mutable ptr to a mutable int
const int * num       = new int(42); // Mutable ptr to a const int
int * const num       = new int(42); // Const ptr to a mutable int
const int * const num = new int(42); // Const ptr to a const int

East-Const (Right to Left (RTL))

int * num             = new int(42); // Mutable ptr to a mutable int
int const * num       = new int(42); // Mutable ptr to a const int
int * const num       = new int(42); // Const ptr to a mutable int
int const * const num = new int(42); // Const ptr to a const int