7.3 Composite Variables
The places to store values described previously were all atomic in nature; that is, each place could hold only one piece of data, which cannot be divided into smaller parts. We have also used a string of letters within quotations to represent a message to be written out. As you might expect, letters within quotations are called strings. If we were to store a string, the number of locations required would depend on the number of characters in the string. Thus a string is not atomic because it contains more than one value, but we tend to think of strings as atomic anyway because we do not access the individual letters.
In this section, we describe two ways of collecting data items together, giving the collection a name, ...
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.
Read now
Unlock full access