Hi Konrad,
as Dennis suggests I'd really need a little bit more info, such as the programming environment, C or C++, etc. Below is a worst case C possible solution that dynamically allocates an array of dynamically allocated char* strings. This might solve your problem, but as always treat other people's code with suspicion as I've not really tested it. C++ has alot more toys in CString from memory.
Best Regards
Ken
#include
#define TRUE 1
#define FALSE 0
#define MAXSTRING 20 // think hard about this one
#define YOURNUMBEROFSTRINGS 6
int hello(void);
int main()
{
hello();
}
int hello(void)
{
char** array;
int i =0;
char yourstring[MAXSTRING] = "hello";
int more = TRUE;
int stringCounter =0;
array = mal
loc (sizeof(char*)*YOURNUMBEROFSTRINGS);
while (more)
{
array[i] = malloc (sizeof(yourstring)); // allocate enough memory
strcpy(array[i],yourstring);// remember to terminate your strings if not already done so
i++;
if (i== YOURNUMBEROFSTRINGS) // loop exit condition of your choice goes here (eg out of strings)
{
more = FALSE;
}
}
stringCounter = i;
// dont forget to free dynamic memory allocation
i =0;
while (i {
free(array[i]);
i++;
}
free(array);
return 0;
}