Skip to content

Instantly share code, notes, and snippets.

@moonjuice
Last active August 29, 2015 14:17
Show Gist options
  • Save moonjuice/1d118bb6e0a00218da45 to your computer and use it in GitHub Desktop.
Save moonjuice/1d118bb6e0a00218da45 to your computer and use it in GitHub Desktop.
Class A{
int A::B(double *x, double *y, double *z){
if(x) *x = 10;
if(y) *y = 10;
if(z) *z = 10;
return 1;
}
void main(){
double oldX = 1;
double oldY = 1;
double oldZ = 1;
//oldX, oldY, oldZ now is 1;
new A()->B(&oldX, &oldY, &oldZ);
//oldX, oldY, oldZ now is 10;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment