There is a task, you need to compare a string with an array of strings. I don't know if I'm doing the right thing. It works, but I would like it to be somehow more elegant .. I think this solution is redundant. Or is it ok?
char *data[] = { "data1", "data2", "data3", "data4", NULL };
char *p;
UINT i = 0;
do
{
p = data[i];
/* doing something with string */
i++;
} while (p!=NULL);