i know the way to subtract 1 from a variable. its like x-- right? with x ur variable name? how about taking away more than one? i would use a while statement right? thx
i know the way to subtract 1 from a variable. its like x-- right? with x ur variable name? how about taking away more than one? i would use a while statement right? thx
useOriginally posted by oobootsy1
i know the way to subtract 1 from a variable. its like x-- right? with x ur variable name? how about taking away more than one? i would use a while statement right? thx
x -= 4;
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
or x=x-4, but I always use x-=4
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
by default when you want to subtract from a variable
x=x-4;
but in C we found that you can make
x-=4;
which is ofcourse easier
for more simplification there is a way ONLY for incrementing to decrementing
x++; //incrementing
x--; for decrementing
But as Walt and major said concerning subtractin more than one its prefered to make
x-=4;
ill just make it a new value. like x=3. thx anyways