Sams Teach Yourself C in 21 Days

(singke) #1

DAY 9


WEEK 2


Understanding Pointers


Today’s lesson introduces you to pointers, an important part of the C language.
Pointers provide a powerful and flexible method of manipulating data in your
programs. Today you will learn:


  • The definition of a pointer

  • The uses of pointers

  • How to declare and initialize pointers

  • How to use pointers with simple variables and arrays

  • How to use pointers to pass arrays to functions
    As you read through today’s lesson, the advantages of using pointers might not
    be immediately clear. The advantages fall into two categories: things that can
    be done better with pointers than without, and things that can be done only with
    pointers. The specifics should become clear as you read this and subsequent
    days’ lessons. At present, just know that you must understand pointers if you
    want to be a proficient C programmer.


15 448201x-CH09 8/13/02 11:21 AM Page 195

Free download pdf