-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointers.c
More file actions
41 lines (25 loc) · 687 Bytes
/
pointers.c
File metadata and controls
41 lines (25 loc) · 687 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
/*
$value =0x125 =0x1234 &=0x1234
$memValue **=10 *==10 ==10 +-----------+
$var pptr+->ptr+----> var+------->+ 10 |
$address 0x126 0x125 | |
+-----------+
0x1234
*/
int main()
{
int var = 10;
printf("%d , %u\n", var, &var);
int *ptr = &var;
printf("\n%d , %u , %u\n", *ptr, ptr, &ptr);
int **pptr = &ptr;
printf("\n%d , %u , %u\n", **pptr, pptr, &pptr);
// printf("%d\n", );
return 0;
}
/**** $output>
10 , 3880540628
10 , 3880540628 , 3880540616
10 , 3880540616 , 3880540608
****/