0
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h> 

int main (int argc, string argv[])
{
    if (xxx)
    {
        do this;
        return 1;
    }

    else 
    {
        do this;

        for (x; x; x)
        {
            if (xxx)
            {
                if (xxx)
                {
                    do this;
                }

                else 
                {
                    do this;
                }
            }

            if else (xxx)
            {
                if (xxx)
                {
                    do this;
                }
                else 
                {
                    do this;
                }

            }

            else
            {
                do this;
            }
        }
    }
printf("\n");
return 0;

}

I am getting an error at my if else line:

ceasar3.c:55:16: error: expected '(' after 'if'
            if else (p[i] >= 'a' && p[i] <= 'z')

I checked my braces and they matched up. Everything that needs ; seems to have them. main doesn't have a ;. I've done some reading and Googling and have had no luck. Any ideas as to what's wrong?

1 Answer 1

0

Doh!

I flipped "else if" and wrote "if else" thus the compiler was looking for a "(" after the if. Ah the trails of being a coding newb!

You must log in to answer this question.

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