I have doubts. In initializing this in C ++:
char** A_Function()
{
char** charList = new char*[2];
charList[0] = "abcde";
charList[1] = "fghij";
return charList;
}
There is no problem "when compiling this code," but I'm not sure about the behavior.
1 - char list: char * is on ok heap? 2 - charList [n_position] is on the heap or stack?
I do not understand what char * [2] realy means, does this mean: Its a static array that has a pointer to char on each of its elements?
If it is static, this array will be allocated on the stack, so is this array a huge error maker?
If I am right, how to allocate it in a heap?
okami source
share