Beginner C++ problem for homework

Discussion in 'Software' started by mrudella, Sep 16, 2004.

  1. mrudella

    mrudella Private First Class

    Hi all,
    I'm new to C++ so I'm pretty sure someone will know what's the deal here. I have attached a screen shot with the code on it. FYI, we are using a program called PuTTY to login to the linux server. I have narrowed it down to the line with the equation for the batting average. If I take the line out, the complier won't find anything wrong. With that line in, here are the errors that I receive:
    hw2.cpp: In function `int main()':
    hw2.cpp:31: parse error before `<<' token
    Thanks!!
     
  2. Wookie

    Wookie Sergeant Major

    I cant seem to find the attachment, just cut and paste the code.
     
  3. mrudella

    mrudella Private First Class

    Click here to see the screen shot
     
  4. Wookie

    Wookie Sergeant Major

    Got an error about angelfire not allowing remote linking. Just cut and paste the code if you can, easier for me cause I can compile it and look at the errors myself.
     
  5. Wookie

    Wookie Sergeant Major

    nm I just copied and pasted the link into browser
     
  6. Wookie

    Wookie Sergeant Major

    you forgot a semi colon before that line, where you figure out the avg
     
  7. mrudella

    mrudella Private First Class

    Putty is Unix based and I'm not sure if you can copy from it??
     
  8. Wookie

    Wookie Sergeant Major

    you can copy, theres a option called select that lets you high light the text and copy it.
     
  9. Wookie

    Wookie Sergeant Major

    and FYI Putty is not "Unix Based" it allows connection to a telnet or SSH server, whether Unix, Linux or Windows.
     
  10. mrudella

    mrudella Private First Class

    That did it... feel so stupid, concidering I typed that line over 5 times to find the problem....Thanks a lot!!
     
  11. Wookie

    Wookie Sergeant Major

    Get used to it. Ive been staring at this sql statement for 30 mins trying to figure out why this database tells me its not right.

    Wait till you have 100 lines of code and miss 3 or 4 of those.

    You find one, think you got it fixed then get another compiler error.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds