The char and string Types
This should give you some idea of how numeric variables and values work. But what about nonnumeric ones?
This brings us to the subject of two new variable types and the values they can contain. These are the char (short for “character”) and its relative, the string. What are these good for, and how do they work?[22]
[22] In case you were wondering, the most common pronunciation of char has an a like the a in “married”, while the ch sounds like “k”.
A variable of type char corresponds to 1 byte of storage. Since a byte has 8 bits, it can hold any of 256 (28) values; the exact values depend on whether it is signed or unsigned, as with the short variables we have seen before.[23] Going strictly according to this description, ...
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