6 Arrays, Pointers, and Strings
So far, we’ve used very simple integers to represent data. But let’s face it, not everything in the world can be described as a single integer. In this chapter you’ll learn some of the basics of organizing your data.
First, you’ll learn about arrays, which are data structures that hold multiple items you can select using an integer index. I’ll also go a little beyond simple arrays to show you how the compiler implements arrays and how arrays implement strings of characters like "Hello World!\n"
. Along the way, you’ll learn to work with C’s char
type.
You’ll learn how to use memory pointers, which hold the ...
Get Bare Metal 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.