c-basic/callreference.c

23 lines
343 B
C
Raw Normal View History

2022-11-24 21:04:54 +01:00
#include <stdio.h>
int* ref(int *i, int* j, int* result){
*result = *i + *j;
return result;
}
int val(int a, int b){
return a+b;
}
int main(){
int x = 1000;
int y = 337;
int z;
printf("given: %d\n", x);
printf("reference: %d\n", *ref(&x, &y, &z));
printf("value: %d\n", val(x, y));
return 0;
}