Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

compiler error

I am writing a program and when i compile the following...

while ((suit !== C) || (suit !== S) || (suit !== D) || (suit !== H))
{printf("What is the suit of your card (C, S, D, H): ");
scanf("%d", &suit);
if ((suit == C) || (suit == S) || (suit == D) || (suit == H))
value_of_card(rank, suit);
}

i get the following error...

error: expected expression before '=' token

this error applies to the first line. Any ideas?? Thanks

Comments

  • zibadianzibadian Member Posts: 6,349
    : I am writing a program and when i compile the following...
    :
    : while ((suit !== C) || (suit !== S) || (suit !== D) || (suit !== H))
    : {printf("What is the suit of your card (C, S, D, H): ");
    : scanf("%d", &suit);
    : if ((suit == C) || (suit == S) || (suit == D) || (suit == H))
    : value_of_card(rank, suit);
    : }
    :
    : i get the following error...
    :
    : error: expected expression before '=' token
    :
    : this error applies to the first line. Any ideas?? Thanks
    :
    To test inequality you need to use the != symbol instead of !==.
Sign In or Register to comment.