Yes it will fail. It will fail to do what they said they wanted it to. It will fail on the first test, and enter the if statement if anything other than "firstname" is entered for the first check. They said they want it to "continue past" if blah blah. Well it won't. It will always enter the first loop. Don't believe me?
Code:
#include<stdio.h>
#include<string.h>
int main( void )
{
char *foo[] = { "firstname", "surname", "middlename" };
size_t x;
for( x = 0; x < sizeof( foo ) / sizeof( foo[0] ); x++ )
if ( (strcmp ( foo[ x ],"firstname") != 0)
|| (strcmp ( foo[ x ],"surname") != 0)
|| (strcmp ( foo[ x ],"middlename") != 0) )
{
printf("Failed.\n");
}
return 0;
}
Read'm and weep.
Like I said, you have to use and. The confusion comes from the OP's wording. The test doesn't "fail" as in evaluate to false always. It fails in the sense that it will never do what they want it to do.
Quzah.