Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing a structure char array to a string ....... 1

Status
Not open for further replies.

johnfdutcher

Programmer
Dec 16, 2003
12
0
0
US
The 'C' compiler returns a message:
parse error before '||'

when compiling this line of code, given that 'rec' is a structure of which 'regnbr' is a member
i.e. char regnbr[4]:

if (strcmp(rec.regnbr,"XXXX") == 0) ||
(strcmp(rec.regnbr,"xxxx") == 0) {
return 0;
}

This test looks to me like a lot of them I see in the 'books' ????
 
[tt]
if (strcmp(rec.regnbr,"XXXX") == 0) ||
[/tt]
Check the number and balance of your parentheses
The || is outside the top-level () of the if statement

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top