Parse Error

This is a discussion on Parse Error within the C++ Programming forums, part of the General Programming Boards category; When working on a program, I am getting this: In funtion 'int main()' 61: Parse Error at end of input. ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    34

    Exclamation Parse Error

    When working on a program, I am getting this:
    In funtion 'int main()'
    61: Parse Error at end of input.

    Can someone tell a new C++ user what the heck that means when I attempt to compile the program?
    http://members.ebay.com/aboutme/the_ski/

  2. #2
    Ethereal Raccoon Procyon's Avatar
    Join Date
    Aug 2001
    Posts
    189
    General syntax error, I think. Make sure all braces and parentheses are closed and that you didn't misspell any functions.

  3. #3
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    You may also have a stray character somewhere (such as a comma or something). It would help to see some of your code.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    All parenthasies are closed. Functions are spelled right.
    http://members.ebay.com/aboutme/the_ski/

  5. #5
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Yeah, these things can be elusive. Post your code, and we can help. Also make sure you don't have a semi-coloc (;) after the last brace. This is a mistake that I have seen made in the past.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    #include <iostream>

    using std::cout;
    using std::cin;
    using std::endl;

    int main()
    {
    int num1, a1, b1, c1, d1, e1, subnum1;
    cout << "Please enter a number: ";
    cin >> num1;
    subnum1 = num1;
    while ( subnum1 > 9999 )
    {
    subnum1 = subnum1 - 1;
    a1 = a1 + 1;
    }

    [this while loop is used a few more times]

    cout << "your number is " << num1;
    cout << "your integer is " << a1;
    return 0;
    }

    This is just a little bit of my code.
    Last edited by TheSki; 09-14-2001 at 06:42 PM.
    http://members.ebay.com/aboutme/the_ski/

  7. #7
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    You've used the >> operator for your final two output statements when you should use << with cout.

    You've use a variable named subnum in your while loop have declared a variable called subnum1 (did you mean this).

    a1 is never initialised so will contain junk when outputted.

    These are the only things I can see that is wrong with the code you've posted (I don't know if these errors are in your original code or are as a result of cutting a bit out).

  8. #8
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    In your while loop, 'subnum' should presumably be 'subnum1' (unless it was declared in a piece of code not posted, then it is fine). Also, 'cout' uses the '<<' operator, not the '>>' operator.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  9. #9
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Rats! You beat me by a minute zen.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  10. #10
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    Thank you for your input but the problems that you mention was my own dislexia from retyping the program here. In my program, the code errors you mention are that way in the program, it is just when I typed it here to show you, I was typing fast and had the fat finger problem.
    http://members.ebay.com/aboutme/the_ski/

  11. #11
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,668
    > from retyping the program here
    Well use the "Attach file:" feature at the bottom of the message compose window next time.
    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.

  12. #12
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    I appreciate the help, but I am using a Putty connection to the unix server at my school from home. Everything is done on the network and I am unable to use the windows cut, copy, paste method. (eliminates that cheating among students thing)

    Anyways, Still unable to get the program to compile.

    Thank you to all your help, going to go in and talk to a tutor at school tomorrow to see what I am doing wrong.
    http://members.ebay.com/aboutme/the_ski/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. How to monitor process creation?
    By markiz in forum Windows Programming
    Replies: 31
    Last Post: 03-17-2008, 02:39 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 06:33 AM
  4. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 12:10 AM

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