Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a multilevel pointer?

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 ***?

like image 618
Claudiu Avatar asked Mar 10 '14 18:03

Claudiu


People also ask

What is multilevel pointer in C?

Multilevel pointers: A pointer is pointer to another pointer which can be pointer to others pointers and so on is know as multilevel pointers. We can have any level of pointers.

What are pointers in c?

A pointer is a variable that stores the memory address of another variable as its value. A pointer variable points to a data type (like int ) of the same type, and is created with the * operator.


1 Answers

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.

like image 75
TypeIA Avatar answered Oct 08 '22 19:10

TypeIA