Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void f1(int *v)
- {
- printf("f1: %d\n", *v);
- }
- void f2(int *v1, int **v2)
- {
- *v2 = v1;
- }
- int main()
- {
- int a = 123;
- int b = 789;
- int *p;
- p=&a;
- printf("a: %d\n", a);
- printf("b: %d\n", b);
- f1(p);
- printf("*p: %d\n", *p);
- f2(&b, &p);
- printf("*p: %d\n", *p);
- return 0;
- }
- /*
- output:
- a: 123
- b: 789
- f1: 123
- *p: 123
- *p: 789
- */
Advertisement
Add Comment
Please, Sign In to add comment