#include <stdio.h>
void foo(int in1, int in2, int *out1, int *out2)
{
// do something
*out1 = 1;
*out2 = 2;
}
int main(void)
{
int in1, in2, out1, out2;
in1 = in2 = out1 = out2 = 0;
printf("in1 = %d, in2 = %d, out1 = %d, out2 = %d\n", in1
, in2
, out1
, out2
);
foo(in1, in2, &out1, &out2);
printf("in1 = %d, in2 = %d, out1 = %d, out2 = %d\n", in1
, in2
, out1
, out2
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGZvbyhpbnQgaW4xLCBpbnQgaW4yLCBpbnQgKm91dDEsIGludCAqb3V0MikKewoJLy8gZG8gc29tZXRoaW5nCgkqb3V0MSA9IDE7Cgkqb3V0MiA9IDI7Cn0KCmludCBtYWluKHZvaWQpCnsKCWludCBpbjEsIGluMiwgb3V0MSwgb3V0MjsKCWluMSA9IGluMiA9IG91dDEgPSBvdXQyID0gMDsKCXByaW50ZigiaW4xID0gJWQsIGluMiA9ICVkLCBvdXQxID0gJWQsIG91dDIgPSAlZFxuIiwgaW4xLCBpbjIsIG91dDEsIG91dDIpOwoJCglmb28oaW4xLCBpbjIsICZvdXQxLCAmb3V0Mik7CglwcmludGYoImluMSA9ICVkLCBpbjIgPSAlZCwgb3V0MSA9ICVkLCBvdXQyID0gJWRcbiIsIGluMSwgaW4yLCBvdXQxLCBvdXQyKTsKCQoJcmV0dXJuIDA7Cn0=