In C, strings aren't compared with just ==. Instead, a library function called strcmp() is used:
You'll want to look it up (I can't at the moment), but it's something like this iirc:
Code:
if(strcmp(pointer2string1, pointer2string2) == 0)
/* strings are the same with 0, target string is greater if it returns 1, and target is less if it returns -1.
DON'T quote me on which is -1 and which is 1, I don't do much programming with strings, in C.
*/
You'll need to #include <string.h> to use strcmp.
Edit: Also, printf doesn't work like this:
Code:
printf(monthNames[0]);
What you want is either a literal string in double quotes:
printf("hello world!");
or
printf("\n %s ", monthName[0]);
where the \n give you a newline, the %s tells printf that you want it to
print a string (%d or %i for integers), and finally, the data which corresponds
to the string printing you want done.