Created
January 13, 2013 13:41
-
-
Save y-yu/4524171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void plus_minus(int *a, int *b) | |
{ | |
int t1 = *a, | |
t2 = *b; | |
*a = t1 + t2; | |
*b = t1 - t2; | |
} | |
int main() | |
{ | |
int a = 1, b = 2; | |
plus_minus(&a, &b); | |
printf("%d %d\n",a,b); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment