4

Arrays and Pointers

Learning Objectives

In this chapter, you will learn about:

  • The limitation of basic data types
  • Derived data types: array type and pointer type
  • Arrays
  • Single-dimensional and multi-dimensional arrays
  • Declaration and usage of arrays
  • Memory representation of arrays
  • Different ways of storing multi-dimensional arrays
  • Pointers
  • Operations allowed on pointers
  • Pointer arithmetic
  • void pointer and null pointer
  • Relationship between arrays and pointers
  • Arrays of pointers
  • Pointer to a pointer
  • Pointer to an array
  • Advantages and limitations of arrays

4.1 Introduction

So far you have learnt about the basic data types, expressions and statements. In the previous chapter, you have learnt the use of iteration statements to perform repetitive ...

Get Programming in C: A Practical Approach, First Edition 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.