User Tools

Site Tools


notes:data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:data [2018/08/23 09:43] – [Notes] cmerola2notes:data [2018/10/24 23:39] (current) – [URLs] ktodd3
Line 10: Line 10:
 ======URLs====== ======URLs======
 Binky Pointer Video: Binky Pointer Video:
-https://www.youtube.com/watch?v=f-pJlnpkLp0+ 
 +[[https://www.youtube.com/watch?v=f-pJlnpkLp0|Binky Pointer Video]] 
 + 
 +[[https://www.learn-c.org/en/Linked_lists|Basic linked list tutorial ]]
 ======Notes====== ======Notes======
 +====Pointers:====
 +
 char x = 0; char x = 0;
  
Line 33: Line 38:
        0xcoffee        0xcoffee
                
-Make y = deadbeef without using "deadbeef" by using the address (&)+Access an address with & 
 + 
 +Make y = deadbeef without using "deadbeef" by using the address (&my man. 
    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 '0' x contains the data '0'
  
 +If we do this:
     |0|     |0|
     ---     ---
Line 50: Line 60:
    *y = 13;    *y = 13;
  
-Now:+Then:
     |13|     |13|
     ----     ----
Line 59: Line 69:
        y        y
        0xcoffee <- address        0xcoffee <- address
-x is now 13 because y is x's address, and you 'pointed' 13 to the address+ 
 +x is now 13 because y is x's address, and you 'pointed' 13 to the address. Ill, dog. 
 + 
 + 
 +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======
notes/data.1535031817.txt.gz · Last modified: 2018/08/23 09:43 by cmerola2