Find the size of char**

Hello. I have the following problem: I have a char** pointer and I need to make a copy of the data it points to without knowing its dimensions.

For every char* after dereferencing once I can use strelen(), but how do I find how many char* references are there?

If, for example, one would view this char** as a pointer to a char matrix, how can I find the number of lines?

Any advice is greatly appreciated.
I think that it is impossible to do this dynamically once the array is passed to a function. You need to keep track of the dimensions manually.
Well.. I tried to make an analogy with delete[]... It doesn't need the size in order to deallocate the memory, but then, I do not know how it is implemented exactly. I thought it may be something similar...

Thank you for the reply. :)
Topic archived. No new replies allowed.