STRCMP receives error
I am getting an error when I am trying to do a strcmp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
char* type;
void DECLIST()
{
if (strcmp(type, "LOCAL") == 0 || strcmp(type, "GLOBAL") == 0)
{
cout << "DECLIST -> DEC DECLIST\r\n";
DEC();
DECLIST();
}
else if (strcmp(type, "id") == 0 || strcmp(type, "READ") == 0 || strcmp(type, "PRINT") == 0 || strcmp(type, "IF") == 0 || strcmp(type, "WHILE") == 0 strcmp(type, "FOR") == 0 || strcmp(type, "END") == 0)
{
cout << "DECLIST -> epsilon\r\n";
}
}
|
This is the error I receive:
error: expected `)' before 'strcmp'
Thanks for the help,
...strcmp(type, "WHILE") == 0 strcmp(type, "FOR") == 0...
What happens if you put in the missing ||
in this bit?
Topic archived. No new replies allowed.