Help Someone! First program/errors and its due tonight!

This is a discussion on Help Someone! First program/errors and its due tonight! within the C Programming forums, part of the General Programming Boards category; Does anyone know what a parse error is? I think I am missing something and this program is due tonight. ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    7

    Question Help Someone! First program/errors and its due tonight!

    Does anyone know what a parse error is? I think I am missing something and this program is due tonight. I am trying to write a program that converts measurements of length.
    Attached Files Attached Files

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Missing ; are frequently a cause of parse errors.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    494
    it would be better if you actually posted your program using the code tags.Even so i downloaded and took a look at it.
    you should check the following.
    Code:
    Case 5: /* inches to feet */
    should not be in capital.

    wrong way.
    Code:
    j=i/12
    right way
    Code:
    j=i/12;
    you are fogetting the semicolon inside the cases.
    When no one helps you out. Call google();

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    7
    thank you so much! I will remember to post the code in the future!

  5. #5
    Registered User
    Join Date
    Mar 2004
    Posts
    494
    i think you should check your calculations again, im not sure they are right. check here for more details. http://www.titaniumart.com/metric-conversion.html

    edit: you should also check your printf statments, not all of them should give you an output in mi(miles)
    Code:
    case 8:  /* feet to inches */
                j=i*12;
                printf(" There are %d mi\n", j);
                break;
    read what you have in the comment and what you have in your output.
    edit 2: always return 0; at the end of your program. you are missing that too.
    Last edited by InvariantLoop; 02-02-2005 at 08:35 AM.
    When no one helps you out. Call google();

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21