Thread: Why am I getting this error...?

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    8

    Why am I getting this error...?

    So I have to write a program for class, but I wont get into details about it. I've started it and have ran into an error that I can't seem to figure out.

    I get the error
    syntax error before '=' token
    on line
    lowertixprice = lowertix * LOWER_BOWL_TIX_PRICE;

    Code:
    #include <stdio.h>
    
    #define LOWER_BOWL_TIX_PRICE = 50.00;
    #define UPPER_BOWL_TIX_PRICE = 25.00;
    
    int main(void)
    {
    int lowertix, uppertix, games;
    float lowertixprice, uppertixprice;
    float tax, total_tax;
    
    printf("How many lower bowl seats do you want? ");
    scanf("%d", &lowertix);
    
    printf("How many upper bowl seats do you want? ");
    scanf("%d", &uppertix);
    
    printf("For many games do you want to buy these tickets? ");
    scanf("%d", &games);
    
    printf("What is the sales tax percentage in your locale? ");
    scanf("%.2f", &tax);
    
    total_tax = (tax/100.00) + 1;
    
    lowertixprice = lowertix * LOWER_BOWL_TIX_PRICE;
    
    printf("%f", lowertixprice);
    
    return 0;
    }
    Note that the program isn't finished yet, stopped after I ran into this error.
    Last edited by Salem; 09-04-2009 at 10:29 PM. Reason: Please don't edit your posts down to nothing after your answer, no one else can learn if you make the answer meaningless.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Where oh where have I seen this before.

    Anyway, read your directions for the problem again, carefully this time, especially the part about #define.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    8
    Just saw the other post about it .
    I see what I had to change, thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM