Thread: What the heck is wrong with this code?

  1. #1
    Shadow12345
    Guest

    What the heck is wrong with this code?

    I was working on this stupid code at my stupid school on stupid visual studio 6.0 and it worked FINE! I emailed the source to myself and it is giving me an error on this line of code:
    Code:
    Spaceship1->ForwardAngle >= Spaceship1->MaxAngle?Spaceship1->ForwardAngle += 0:Spaceship1- >ForwardAngle += -Spaceship1->TiltSpeed;
    The error says:
    lesson1\lesson01\Lesson1.cpp(748) : error C2059: syntax error : '>'



    GOD HATES ME

  2. #2
    Shadow12345
    Guest
    Nevermind for some reason the '->' symbol was cut apart...I fixed it...but I still can't figure out why it does that EVERY TIME I MAIL IT TO MYSELF

    arg!

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    why not email it as an attachment instead?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I think the code is somewhat hard to read.

    Spaceship1->ForwardAngle += 0 //??? Seems unnecessary

    I like something like:
    Code:
    if (SpaceShip->ForwardAngle < Spaceship1->MaxAngle)
     Spaceship1->ForwardAngle -= Spaceship1->TiltSpeed;
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  5. #5
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946

    Re: What the heck is wrong with this code?

    edit: n/m
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what is wrong in this simple code
    By vikingcarioca in forum C Programming
    Replies: 4
    Last Post: 04-23-2009, 07:10 AM
  2. Replies: 7
    Last Post: 08-06-2004, 09:14 AM
  3. what is wrong with this code please
    By korbitz in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2004, 10:11 AM
  4. what's wrong with the following code?
    By catalyst in forum C Programming
    Replies: 1
    Last Post: 11-07-2003, 04:30 AM
  5. can someone check my code and tell me what I'm doing wrong
    By jlmac2001 in forum C++ Programming
    Replies: 7
    Last Post: 09-20-2003, 08:14 PM