1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
int main()
{
int a, b;
a = 123;
int *a_ptr; // * : asterisk
a_ptr = &a; // & : address-of operator
printf("%d %d %p\n", a, *a_ptr, a_ptr);
*a_ptr = 456; // * : re-direction or de-referencing
printf("%d %d %p\n", a, *a_ptr, a_ptr);
b = *a_ptr;
printf("%d\n", b);
*a_ptr = 789;
printf("%d\n", b);
printf("%d %d %p %p\n", a, *a_ptr, a_ptr, &b);
b = 12;
printf("%d\n", b);
printf("%d %d %p\n", a, *a_ptr, a_ptr);
}
Enter to Rename, Shift+Enter to Preview