Question

When reading about const_cast I came across sentences like the following:

Only the following conversions can be done with const_cast. In particular, only const_cast may be used to cast away (remove) constness or volatility.

1) Two possibly multilevel pointers to the same type may be converted between each other, regardless of cv-qualifiers at each level.

I've googled around a bit already and haven't found any concise, straightforward definitions of what a multilevel pointer is. So: what exactly is a multilevel pointer?

(Possible face-palm moment) It it just a pointer to a pointer, or pointer to a pointer to a pointer, e.g. int ** or int ***?

Was it helpful?

Solution

Is it just a pointer to a pointer, or pointer to a pointer to a pointer, e.g. int ** or int ***?

It is exactly this, yes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top