C question. - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: C question. (/showthread.php?tid=66499) C question. by .Roy on 09-21-2006 at 12:39 PM
Well i have this: RE: C question. by Ezra on 09-21-2006 at 12:48 PM Set it in a globally defined variable? RE: C question. by .Roy on 09-21-2006 at 12:58 PM
What? RE: C question. by Ezra on 09-21-2006 at 01:02 PM
I just removed float a and float b initialisation from the main function and put it above it, causing it to become a global variable. code: RE: C question. by John Anderton on 09-21-2006 at 01:11 PM
quote:He wants the swapping function The answer is as follows code: RE: C question. by .Roy on 09-21-2006 at 01:24 PM yeah well my job is to figure it out without swap but nvm dont tell me. RE: C question. by .Roy on 09-21-2006 at 01:25 PM
oh and i also cant do 3 letters RE: C question. by Eljay on 09-21-2006 at 01:33 PM
a = a + b; RE: C question. by .Roy on 09-21-2006 at 01:46 PM
lol that works eljay thanks RE: C question. by RaceProUK on 09-21-2006 at 02:23 PM
quote:An example: a = 4; b = 6; a = a + b; // 10 b = a - b; // 4 a = a - b; // 6 a == 6 && b == 4; // true RE: C question. by .Roy on 09-21-2006 at 03:53 PM
yes i managed to make mine work since u guys werent supposed to tell me the answer o.O RE: C question. by RaceProUK on 09-26-2006 at 11:29 AM
quote:* RaceProUK slaps .Roy around a bit with a large trout. That will be many times slower than using the add-subtract method above. Processors can add and subtract many times faster than they can multiply or divide. |