#include <stdio.h>
void calc(int c) {
printf("calc %d %p\n", c, (void *)&c);
c++;
printf("calc %d %p\n", c, (void *)&c);
}
int main() {
int c = 11;
printf("main %d %p\n", c, (void *)&c);
calc(c);
printf("main %d %p\n", c, (void *)&c);
}
E
#include <stdio.h>
void calc(int* c) {
printf("calc %d %p\n", (*c), c);
(*c)++;
printf("calc %d %p\n", (*c), c);
}
int main() {
int c = 11;
printf("main %d %p\n", c, (void *)&c);
calc(&c);
printf("main %d %p\n", c, (void *)&c);
}