This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
notes:data [2018/08/23 13:41] – [Notes] cmerola2 | notes:data [2018/10/04 01:24] – [URLs] ktodd3 | ||
---|---|---|---|
Line 9: | Line 9: | ||
ael0 | ael0 | ||
======URLs====== | ======URLs====== | ||
+ | Binky Pointer Video: | ||
+ | https:// | ||
+ | [[https:// | ||
======Notes====== | ======Notes====== | ||
+ | ====Pointers: | ||
+ | |||
char x = 0; | char x = 0; | ||
Line 32: | Line 37: | ||
| | ||
- | -Make y = deadbeef without using " | + | Access an address with & |
+ | |||
+ | Make y = deadbeef without using " | ||
y = &x | y = &x | ||
- | Now, y's data is the address of x | + | Now, y's data is the address of x. |
- | x contains the data ' | + | |
+ | x contains the data ' | ||
+ | |||
+ | If we do this: | ||
|0| | |0| | ||
--- | --- | ||
Line 49: | Line 59: | ||
*y = 13; | *y = 13; | ||
- | Now: | + | Then: |
|13| | |13| | ||
---- | ---- | ||
Line 58: | Line 68: | ||
y | y | ||
| | ||
+ | |||
+ | x is now 13 because y is x's address, and you ' | ||
+ | |||
+ | |||
+ | Double pointers are arrays or whatever | ||
+ | | | | ||
+ | ------------ | ||
+ | z | ||
+ | | ||
+ | signed char **z = NULL; | ||
+ | | ||
+ | So we're gonna give this some garbage | ||
+ | |0xcoffee| | ||
+ | ---------- | ||
+ | z | ||
+ | 0xc05fefe | ||
+ | And do nothing with it because we kind of just stopped I think. | ||
+ | | ||
+ | Memory addresses are 8 bytes on 64 bit linux systems. | ||
+ | 4 bytes on 32 bit linux systems. | ||
======Other====== | ======Other====== |