What does the declaration `string' mean in C, anyway? There is std::string in C++, and there is the string.h header file in C. You probably mean
Code:
char *numbers[5] = {"one", "two", "three", "four", "five"};
As was already mentioned, strcmp() is for comparing strings. However, if you *really* want to compare strings with the == operator, then you must make sure you are comparing objects with the same address:
Code:
char *S_ONE = "one";
char *S_TWO = "two";
/* ... */
int main(void) {
char *numbers[5] = {S_ONE, S_TWO, S_THREE, S_FOUR, S_FIVE};
char *s = numbers[2];
printf("%s\n", s == S_THREE ? "You got it." : "Nope.");
return 0;
}