d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Yo, Canadians
Prev111121314Next
Add Reply New Topic New Poll
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 7 2011 10:36am
Quote (Grillz9909 @ Jun 7 2011 09:35am)
You'll be forced to sell some 40 year old guy $100 ram that he could buy for $40 on newegg. And you'll have to tell him it's a good deal and ask if he wants the $30 warranty on it too

:( I couldn't do it


Geek squad, son.
Member
Posts: 6,522
Joined: Jun 5 2008
Gold: 0.00
Jun 7 2011 11:45am
Quote (BreakPoint @ Jun 7 2011 11:36am)
Geek squad, son.


microcenter tech >
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jun 7 2011 11:49am
Quote (Grillz9909 @ Jun 7 2011 09:30am)
:lol: duck works there


wut?

also python is gay use a real language :3
Member
Posts: 17,029
Joined: Mar 28 2010
Gold: 519.00
Warn: 50%
Jun 7 2011 11:49am
Quote (AbDuCt @ Jun 7 2011 01:49pm)
wut?

also python is gay use a real language :3


give example :rofl:

This post was edited by charlyak on Jun 7 2011 11:50am
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jun 7 2011 12:08pm
Quote (charlyak @ Jun 7 2011 10:49am)
give example  :rofl:


c++ :3

uses sexy references so you don't have to be a pointer whore to swap two values v.v

ex:

C

Code
void swap(int *a, int *b)
{
  int buff = *a;
  *a = *b;
  *b = buff;
}

useage:   swap(&someint, &someint2);



c++

Code
void swap(int &a, int &b)
{
  int buff = a;
  a = b;
  b = buff;
}

useage: swap(value1, value2);
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 7 2011 12:20pm
Quote (DeadShell @ Jun 7 2011 10:45am)
microcenter tech >


There isn't a MicroCenter anywhere near me. :(
e. lol fail, I totally forgot to reply to this

Quote (AbDuCt @ Jun 7 2011 10:49am)
wut?

also python is gay use a real language :3


Python isn't gay. You just jelly.
Code
def swap(a, b):
    buff = a
    a = b
    b = buff

#usage
swap(x, y)


jajajaja

This post was edited by BreakPoint on Jun 7 2011 12:41pm
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jun 7 2011 12:25pm
Quote (BreakPoint @ Jun 7 2011 11:20am)
Python isn't gay. You just jelly.
Code
def swap(a, b):
    buff = a
    a = b
    b = buff

#usage
swap(x, y)


jajajaja


now does that only swap the two variables inside the function or swap the two variables outside it. purpose is to give the memory addresses of the vars and then swap data between them :3
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 7 2011 12:29pm
Quote (AbDuCt @ Jun 7 2011 11:25am)
now does that only swap the two variables inside the function or swap the two variables outside it. purpose is to give the memory addresses of the vars and then swap data between them :3


Doesn't return any values, so it's just within the function.

But you could probably do
a, b = b, a
return a, b
Member
Posts: 27,059
Joined: Nov 29 2006
Gold: 67.00
Jun 7 2011 12:34pm
nerds
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 7 2011 12:40pm
Quote (Grillz9909 @ Jun 7 2011 11:34am)
nerds


jelly you are
Go Back To Computers & IT Topic List
Prev111121314Next
Add Reply New Topic New Poll