O'Reilly logo

Advanced Topics in C: Core Concepts in Data Structures by Noel Kalicharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3

image

Pointers

In this chapter, we will explain the following:

  • What a pointer is
  • How to declare pointer variables
  • How to dereference a pointer
  • How a function can change the value of a variable in a “calling” function
  • Some issues involved in passing an array as an argument to a function
  • How to work with character pointers
  • The meaning of pointer arithmetic
  • How to use pointers to structures
  • How to use pointers to functions to write general-purpose routines
  • What are void pointers and how to use them

3.1 Defining Pointers

In C, arguments to functions are passed “by value.” Suppose the function test is called with the variable num as an argument. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required