Sams Teach Yourself C in 21 Days

(singke) #1

DAY 15


WEEK 3


Pointers: Beyond the


Basics


On Day 9, “Understanding Pointers,” you were introduced to the basics of
pointers, which are an important part of the C programming language. Today
you’ll go further, exploring some advanced pointer topics that can add flexibil-
ity to your programming. Today you will learn


  • How to declare a pointer to a pointer

  • How to use pointers with multidimensional arrays

  • How to declare arrays of pointers

  • How to declare pointers to functions

  • How to use pointers to create linked lists for data storage


Declaring Pointers to Pointers ............................................................................


As you learned on Day 9, a pointeris a numeric variable with a value that is
the address of another variable. You declare a pointer using the indirection
operator (*). For example, the declaration

25 448201x-CH15 8/13/02 11:13 AM Page 387

Free download pdf