Apr 26, 2010 at 5:55pm UTC
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.
Apr 26, 2010 at 6:08pm UTC
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.
Apr 26, 2010 at 6:53pm UTC
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. :)