1 / 10

Pointer =

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.

errin
Download Presentation

Pointer =

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pointer =

  2. Pointers = Portals? =* Coincidence?

  3. Pointer Intro • Data =

  4. Variables • Data • Variable “int A” • Int A = Data

  5. Pointers = Portals • A pointer is a portal • Whenever you see *, you are using a portal

  6. Interactive Section

  7. Declare a Pointer • Int * p; • Where does this point? • Nowhere, yet

  8. 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

  9. 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?

  10. 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?

More Related