Chapter 21. Bits, Characters, C Strings and structs

 

The same old charitable lie Repeated as the years scoot by Perpetually makes a hit—“You really haven’t changed a bit!”

 
 --Margaret Fishback
 

The chief defect of Henry King Was chewing little bits of string.

 
 --Hilaire Belloc
 

Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences.

 
 --William Strunk, Jr.

OBJECTIVES

In this chapter you’ll learn:

  • To create and use structs.

  • To pass structs to functions by value and by reference.

  • To use typedef to create aliases for previously defined data types and structs.

  • To manipulate data with the bitwise operators and to create bit fields for storing data compactly.

  • To use the functions of the character-handling ...

Get C++ How to Program, Sixth 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.