5

POINTERS

5.1 INTRODUCTION

The use of pointers is one of the most powerful features in C. Pointers are simply variables that point to another variable. Relation between these two variables is established by the fact that the value of the pointer variable is the address of the variable it points to. In this chapter we discuss the basics, understanding the use of pointers.

5.2 FUNDAMENTALS AND DEFINING POINTERS

A pointer is a variable that holds the address of some other variable. Depending on the data type of the variable, amount of bytes in memory is reserved. In the IBM range of machines a character variable requires 1 byte of memory, an integer variable requires 2 bytes, and a floating point-variable requires 4 bytes. Consider the following ...

Get Data Structures Using C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.