Chapter 7. Working with Arrays

THE C LANGUAGE PROVIDES A CAPABILITY that enables you to define a set of ordered data items known as an array. This chapter describes how arrays can be defined and manipulated. In later chapters, you learn more about arrays to illustrate how well they work together with program functions, structures, character strings, and pointers.

Suppose you have a set of grades that you want to read into the computer, and suppose that you want to perform some operations on these grades, such as rank them in ascending order, compute their average, or find their median. In Program 6.2, you were able to calculate the average of a set of grades by simply adding each grade into a cumulative total as each grade was entered. However, ...

Get Programming in C, Third 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.