
Originally Posted by
Hell_Demon
References?
Do you mean
Code:
void PartyPowah(int &x, int &y)
{
x = y * x + y / x;
}
?
I'm tired(02:30 in the morning), GAAAH I dun even know if what i wrote above is functioning code
not sure, but did you mean to say: void PartyPowah(int *x, int *y)?
Because the objective would be calling the function like: partypowah(&x,&y), with the objective of changing the actual x and y without the need to return?
Like (not tested, just wrote here):
Code:
int main()
{
int x,y;
partypowah(&x,&y);
cout << x << " & " << y << endl;
}
partypowah(int *x, int *y)
{
x = 1;
y = 2;
}
and the output would be: 1 & 2.
Not sure if that was what u meant HD or if about this that the OP is talking about xD sry if wrong. Neither sure if this is totally correct, but i think this was the way i got used to do.