⚠ 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 = 1025;
00000000
00000000
00000100
00000001
byte 3
byte 2
byte 1
byte 0
Addresses
203
202
201
200
contiguous block of memory
= 1025
in integer, left-most bit is used to store the information of whether the integer is positive or negative. Its a sign-bit. Rest 31 bits are used to store value.
int* p; p = &a;
print p; print *p;
address of int variable starting at address 200
p is pointer to integer so we need to look at 4 bytes starting address 200.
Machine knows how to extract value of int type.
if p was character pointer, machine would look up at only 1 byte because character variable is only 1 byte. Same for float, 4 bytes but different way of writing compared to integer.
Embedded Files
ed376c6fc719c7b3f92bbe6568a192bde59c9f1b:
1e929ea8ae93fb9461d8b3eafd883646da57562b: