Code:
for (j = 0; j < sizeof(array)/sizeof(array[0]); j++)
j should only run to the array size -1.
Because, if j is the last index, there is no member behind it to check.
should be:
Code:
for (j = 0; j < (sizeof(array) / sizeof(array[0]) - 1); j++)
In the inner loop, you check if member j points to NULL, very good.
But is it NULL, you run the rest of the array with k.
You can check it before k is run.
Directly in the outer loop:
Code:
if (array[j] != NULL) {
int k;
…
}
Line 16 and 18 are both if-statements. You can compine it.
Now that we know that array[j] isn't NULL, we come to the resulting if-statement:
Code:
if (array[k] != NULL && strcmp(array[j], array[k]) == 0)
Also please fix what laserlight says. I let you find out by your self, because it is very simple.
All in all, nice work! Great job. Good formated and indented source, nice.