In header file : char* name;
In CPP file : name = newchar[length];
I need to do similar kind of dynamic declaration for double pointer. Say
In header file : char** names;
In CPP file :Initially i know only the count value. After that once i enter into a loop then only i know the lengths of each name on iteration. So here i want initialize "names" with count alone first like
1 2 3 4 5 6 7
names = char*[10];
for(int i=0;i< 10; i++)
{
int len = array[i].getnamelength();
names[i] = newchar[len];
strcpy(names[i],array[i]);
}