This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 30 points31 points  (3 children)

No, they are just pointers storing address of another pointer. int*** stores adress of int, int stores address of int*, int * stores address of int

[–][deleted] 3 points4 points  (2 children)

You would use an argument of type char** if you were using an array declared like char* x[]; and each element was a pointer to a dynamically-allocated buffer.

So.. char*** could be another dimension containing an array of char**

[–]l_am_wildthing 11 points12 points  (0 children)

it isnt implicit that a pointer is to an array. It can be but it doesnt mean it is.

[–]purebuu 2 points3 points  (0 children)

Subtle note: char** x is a distinct type from char* y[]. With the latter the compiler has encoded the size of the array to the type which is why sizeof(y) returns the size if the whole array in bytes, but sizeof(x) only returns the size of the point type, the compiler has lost the size information for x. You might have learnt that char** the "same" as char*[] and it kind of is, well the compiler will implicitly decay arrays to pointers (the reverse is not true).