Possible Duplicates:
string literal in c
Assigning strings to arrays of characters
I got the following code:
char result[3][4];
result[0] = "horse";
result[1] = "pig";
result[2] = "chicken";
It won’t compile saying Incompatible types in assignment. What am I doing wrong?
char is a single char, eg ‘h’
What you want is string pointers.
Remember if you do it this way you won’t be able to change the contents of an individual string (it is a constant and stored in a different place.)
You could also do something like this