I am trying to create an array of strings in C. If I use this code:
char (*a[2])[14]; a[0]=\"blah\"; a[1]=\"hmm\";
gcc gives me \"warning:
If you don't want to keep track of number of strings in array and want to iterate over them, just add NULL string in the end:
char *strings[]={ "one", "two", "three", NULL }; int i=0; while(strings[i]) { printf("%s\n", strings[i]); //do something i++; };