I have what I think is a simple question.
I have an array as follows:
char array[5][100] = {
"string 1",
"string 2",
"string 3",
"string 4",
"string 5"
};
then I attempt to traverse the array to find a matching string as follows:
int x;
for(x = 0; x < sizeof(array); x++){
if(strncmp(my_buffer, array[x], strlen(array[x])
/* do some stuff */
Do I have this correct, will this work, is the "sizeof" the array what I'm looking for here?
Any info is greatly appreciated.
Thanks All!!