100 likes | 297 Views
Pointer = . Pointers = Portals?. = * Coincidence?. Pointer Intro. Data = . Variables. Data Variable “ int A” Int A = Data. Pointers = Portals. A pointer is a portal Whenever you see *, you are using a portal. Interactive Section. Declare a Pointer.
E N D
Pointers = Portals? =* Coincidence?
Pointer Intro • Data =
Variables • Data • Variable “int A” • Int A = Data
Pointers = Portals • A pointer is a portal • Whenever you see *, you are using a portal
Declare a Pointer • Int * p; • Where does this point? • Nowhere, yet
Recap • intfirstvalue=5; • What does this do? • int* mypointer; • What does this do? • Where does it point? • mypointer= &firstvalue; • Is there a *? • Are you going through a portal? • What does this do? • *mypointer = 10; • Is there a *? • Are you going through a portal? • What does this do? • Firstvalue and *mypointer change
Recap 2 • char a; • char * b; • char ** c; • a = 'z'; • b = &a; • c = &b; • What does c=? • Did you go through a portal? • What does **c=? • How many portals did you go through?
Recap 3 • intfirstvalue=5; • int* mypointer; • mypointer= &firstvalue; • *mypointer++; • Is there a *? • Are you going through a portal? • What does this do? • *mypointer and firstvalue =6; • mypointer++; • Is there a *? • Are you going through a portal? • What does this do?