⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’
Excalidraw Data
Text Elements
int A[5];
int is 4 bytes
216 - A[4]
212 - A[3]
208 - A[2]
204 - A[1]
200 - A[0]
Memory (address - Value)
Memory allocation = 5 x 4 bytes = 20 bytes
one consecutive block of memory allocated.
int x = 5; int* p;
p = &x;
printf(“%p”, p); printf(“%d”, *p);
Horizontal View
2
4
5
8
1
5
200
204
208
212
216
300
A[0]
A[1]
A[2]
A[3]
A[4]
X
Output: p ⇒ 300 *p ⇒ 5
p = p + 1; // 304 (int is 4 bytes so 300 + (1 * 4) = 304 *p ? // Garbage Value (we don’t know)