Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 can someone tell me the use of += and -= operators (SOLVED)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
the_short1




PostPosted: Mon Feb 23, 2004 10:57 pm   Post subject: can someone tell me the use of += and -= operators (SOLVED)

ive seen this in some programs but i do not know how/what it does exactly.... ive looked in turing help under operators... and i searched but no luck in finding it...
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Mon Feb 23, 2004 11:00 pm   Post subject: (No subject)

hehe...
+= is the same as something:=something + something else
-= is the same as something:=something - something else
so
code:

number:=number+1
%is the same as%
number+=1

number:=number-1
%is the same as%
number-=1
the_short1




PostPosted: Tue Feb 24, 2004 7:52 am   Post subject: (No subject)

that was my first guess.... but i wanted to knwo for sure...(also if it has more uses...)

cool... that little things shaves off lots of code...


Thanks,.. (Feeling Like a Noob) Shocked Sad
naoki




PostPosted: Tue Feb 24, 2004 5:46 pm   Post subject: (No subject)

mebbe it's only in C++ but you could also try

*= and
/=
and see if they work as well
apomb




PostPosted: Tue Feb 24, 2004 8:09 pm   Post subject: (No subject)

actually in turing , it works quite well ... i was initially going to reply that even (+=) doesn't work .. but i would have made quite a fool of myself , wouldn't i!? any way ... it works
jonos




PostPosted: Tue Feb 24, 2004 9:00 pm   Post subject: (No subject)

yeah, cervantes uses that a lot and i never understood his code until i understood that. anyways, i wish turing allowed var++ or ++var cause that is SOOOOOO easy. hehe, anyways, everyone go and check out "shadows collide with people" by john frusciante
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: