0
if (strcmp(getType(object), "GRect") == 0)
{
    if(object==rect)
    {
        if(velocity>0)
        {
            velocity=-velocity;
        }
    }
    else
    {
        removeGWindow(window,object);
        velocity=-velocity;
    }
else if(strcmp(getType(object), "GLabel") == 0)
{
    continue;
}
}

jharvard@appliance (~/Dropbox/pset4): make breakout clang -ggdb3 -Ispl/include -O0 -std=c99 -Wall -Werror -Wno-unused-variable -o breakout breakout.c -Lspl/lib -lcs -lm breakout.c:150:17: error: expected expression else if(strcmp(getType(object), "GLabel") == 0) ^ 1 error generated.

  • 1
    In addition to curiouskiwi's answer, keep in mind that your else if is completely unnecessary in this context. You only have to write a handler for the collisions you want to respond to, the continue for all others is implied. – Sean DiSanti Jun 17 '14 at 6:00
1

You haven't closed off your if so the compiler doesn't know what to do with your else if. (I've put through a requested edit that formats the post so it's easy to see where you've misplaced the }.)

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .