Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

WTF, is this code not valid?

Name: Anonymous 2006-06-18 2:48

void add_speed_direction (short direction, short addspeed, short& xspeed, short& yspeed) {
    /*This function adds the desired speed to the speed of the entity that calls it, in
    the direction it wants. This function should acquire its variables from the function
    that calls it.  I hope     this is a legal operation within methods.  Maybe it'll be
    easier to make it a method itself? */
    xspeed* += (addspeed*sin(direction));
    yspeed* += (addspeed*cos(direction));
}

For some reason, it doesn't like my pointers and indirection operators.  Microsoft Visual C++ 6.0 gives me this error when I go to compile it:
e:\docs\projects\space story\space story.h(124) : error C2059: syntax error : '+='
e:\docs\projects\space story\space story.h(125) : error C2059: syntax error : '+='

Name: Anonymous 2006-06-20 23:19

How about not using endl? Type <<"\n" instead.
endl flushes buffered streams. "\n" doesn't.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List