How do I create an array of strings in C?

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: assignment from incompatible pointer type”. What is the correct way to do this?

edit: I am curious why this should give a compiler warning since if I do printf(a[1]);, it correctly prints “hmm”.

Leave a Comment