Thread: need parse help

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    1

    Unhappy need parse help

    i made a code and tried to compile it but it shows up with an error saying "parse before '='. this is the statement that it says is wrong: fahrenhiet = factor * celsius/100 + 32;
    wut do they meen by parse before '='? wut should i do?

    Opps! sorry for the confusion. here's the whole code:

    //
    //Program to convert temerature
    //units in joe
    //Fahrenhiet = Celsius * (212 - 32)/100 +32
    //

    #include <iostream.h>

    int main(int nNumberofArgs, char* pszArgs[])
    {
    //enter the temperature in celsius
    int celsius;
    cout << "Enter the temperature in Celcius:";
    cin >> celsius;

    //calculate conversion factor for celsius
    //to Fahrenhiet
    int factor;
    factor = 212-32;

    //use conversion factor to conver celsius
    //into Fahrenhiet values
    int fahrenhiet;
    fahrenhiet = factor * celsius/100 + 32;

    //output the results
    cout << "Fahrenhiet value is:";
    cout << fahrenhiet;

    return 0;
    }
    Last edited by joe; 01-21-2002 at 09:57 AM.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    a little code would help!!

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    the only thing i can help you with, considering you didn't really give the code that we needed to see.. is that the formula for converting between the 2 is:

    f = 9 * c / 5 + 32;

    and

    c = (f - 32) * 5 / 9;

    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  4. #4
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    A parse error is usually due to an error made in the previous code, things like missing semi-colons, or missing braces, etc. Go to the error line and move up through the code looking for that kind of stuff.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  2. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM