Code:
#include <stdio.h>
int main ()
{
char * strArray1[] = {"Hello", "There"};
char strArray2[][30] = {"How's", "it goin'?"};
printf(strArray1[1]);
putchar('\n');
printf(strArray2[2]);
putchar('\n');
return 0;
}
This isn't complete, but maybe it's what you're looking for? Please note that there is a difference between strArray1 and 2... the first is an array of char * (which have appropriate memory allocated at declaration, just like char * string = "foo" would). The latter is a two dimensional array.
If you don't know how many different strings you'll be using, then you'll need to use pointers instead of arrays, just like any case of not knowing how many elements you'll have...
Code:
int main()
{
int n = 3;
int i;
char** strArray;
strArray = malloc(sizeof (char*) * n);
strArray[1] = malloc (sizeof(char) * (strlen(string1) + 1));
strcpy (strArray[1], string1);
printf(string1);
printf(strArray[1]);
return 0;
}