R
Robert
Hi,
How can i resize an array of strings to add more?
This is an example i just downloaded from a website:
char *cpArray[10];
int i;
for (i = 0; i < 10; i++) cpArray = (char *)malloc(20 * sizeof(char));
strcpy(cpArray[5], "A hat is on the mat");
cpArray[5][3] = 'u';
But this only resizes the lenght of the string...
How is it possible to like add another string to the array?
So that i could change the char *cpArray[10]; in runtime?
Thanks for your time,
Robert
How can i resize an array of strings to add more?
This is an example i just downloaded from a website:
char *cpArray[10];
int i;
for (i = 0; i < 10; i++) cpArray = (char *)malloc(20 * sizeof(char));
strcpy(cpArray[5], "A hat is on the mat");
cpArray[5][3] = 'u';
But this only resizes the lenght of the string...
How is it possible to like add another string to the array?
So that i could change the char *cpArray[10]; in runtime?
Thanks for your time,
Robert