Open DaidalosCheung opened 4 years ago
void alter( int a, int b);
int a, b; scanf("%d, %d", &a, &b); alter(&a, &b); printf("The difference between %d & %d is: %d\n", a, b, *&a); printf("And the sum is %d \n", *&b); return 0; } void alter( int *a, int *b) { int temp = 0; temp = *a; *a = *a - *b; *b = temp + *b; }
a = 20, b = 18 The difference between 2 & 38 is: 2 And the sum is 38
include
void alter( int a, int b);
The first pointer