Skip to Main Content
Practical C++
book

Practical C++

by Rob McGregor
August 1999
Beginner to intermediate content levelBeginner to intermediate
912 pages
15h 44m
English
Que
Content preview from Practical C++

Chapter 6. Using Arrays

<feature>
  • Learn how to define and initialize an array

  • Learn how to access array elements

  • See how to use loops with arrays

  • Find and replace text and formatting

  • Learn to use multi-dimensional arrays

</feature>

Why Use Arrays?

With the exception of character strings, the data types and variables you’ve seen up to this point have been simple data types that store only a single value. Consider these two variables:

char ch = 'B';
int num = 134;

Variables like these are called scalar variables. They can contain only a single value at a time, and you can’t subdivide them further; they are elemental. An array is a group of variables having the same data type.

In writing efficient programs, it’s often convenient to have an array of variables ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C++ Programming, 2nd Edition

Practical C++ Programming, 2nd Edition

Steve Oualline
C++ Cookbook

C++ Cookbook

D. Ryan Stephens, Christopher Diggins, Jonathan Turkanis, Jeff Cogswell

Publisher Resources

ISBN: 0789721449Purchase book