Thread: error expected expression bfore...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Location
    Svitavy, Czech Republic
    Posts
    37

    error expected expression bfore...

    Hello,
    would be somebody so great and could help me with (not only) this problem:
    Code:
    #define CAR_SIZE 101
    
    typedef struct {
        int *ID;
        char brand[CAR_SIZE];
        char model[CAR_SIZE];
        char color[CAR_SIZE];
        float driven;
        float engine_capacity;
        float price;
    
    } car;
    
    int main() {
    int search = 0;
    car first;
    int n = 0;
    for(n=0;n<100;n++);
        pridej(n, car *car[n]);
    }
    printf("Zadej ID\n");
    scanf("%d", &search);
    printf("%d %d\n", search, id_generator(first->ID));
    return 0;
    }
    I need to make bigger program and I am basic, so if somebody could help me I'll be very happy! I am basic programmer and I need help sometimes with something (forums are slow and not so effective for me).

    my email: [email protected]

    Thank you

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Code:
    for(n=0;n<100;n++);
    You've got a semicolon switched in for a brace.

    Code:
    pridej(n, car *car[n]);
    I don't know why typing a comma causes amnesia, but you got the first one right (just an n, no type) and the second one wrong (type erroneously included -- both in that the type shouldn't be there and in that car[n] is a car, not a car*).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expected expression error
    By Peter Barnett in forum C Programming
    Replies: 3
    Last Post: 09-10-2013, 11:16 AM
  2. error: expected an expression
    By cdmstr in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2011, 02:00 PM
  3. Compiling error expected expression.
    By tasmod in forum C Programming
    Replies: 10
    Last Post: 08-12-2010, 04:26 PM
  4. error: expected expression before ‘{’ token
    By nendariani in forum C Programming
    Replies: 7
    Last Post: 09-14-2008, 11:27 AM
  5. Error: expected an expression!
    By bobthebullet990 in forum C Programming
    Replies: 2
    Last Post: 01-05-2007, 09:05 AM