Chapter 6

Pointers

The use of pointers is one of the most powerful features in C. In this chapter, we present the basics of using pointers. The examples in this chapter will help in writing programs in C by efficient usage of pointers. It may simply be stated that a pointer is a variable that can point to another variable. More precisely, a pointer is a variable that can hold the address of another variable. So far, we have seen variables that hold a value of a specific type, viz. int, char, float. So, pointer variables are special in the sense that their usage is somewhat different than the variables we have discussed so far.

6.1 | DEFINING A POINTER

As the use of pointer variables is different from other variables, there must be a way to ...

Get C Programming Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.