This is an old revision of the document!
Corning Community College
CSCS2320 Data Structures
Course Wiki Page
dsi0 ael0
Binky Pointer Video: https://www.youtube.com/watch?v=f-pJlnpkLp0
char x = 0;
char → 1 byte (8 bits) Default char → signed (2^8 → 256 → -128, +127 [one is used for positive/negative value])
the asterisk (*) indicates a “pointer”
signed char *y = NULL; ^
(void*)0 Void pointers are raw memory
|0| --- x 0xdeadbeef |NULL(0)| --------- y 0xcoffee -Make y = deadbeef without using "deadbeef" by using the address (&) y = &x Now, y's data is the address of x x contains the data '0'
|0| --- x 0xdeadbeef <- address |0xdeadbeef| ------------ y 0xcoffee <- address x = 7; *y = 13;
Now: |13| ---- x 0xdeadbeef <- address |0xdeadbeef| ------------ y 0xcoffee <- address