Skip to Content
C++20 for Programmers: An Objects-Natural Approach, 3rd Edition
book

C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

by Paul Deitel, Harvey Deitel
April 2022
Intermediate to advanced
1012 pages
38h 1m
English
Pearson
Content preview from C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

E. Bit Manipulation

E.1 Introduction

This appendix discusses the manipulation of bits in integer data. We discuss the bitwise operators that allow you to access and manipulate the individual bits in bytes of data. We also present bit fields—structures that can be used to specify the exact number of bits a variable occupies in memory.

C++ provides extensive bit-manipulation capabilities for getting down to the “bits-and-bytes” hardware level. Bit manipulation is typically used in programs that need to communicate directly with hardware. It’s also used in encryption data compression and other algorithms.1 We introduce each bitwise operator and discuss how to save memory by using bit fields.

1. “Bit manipulation.” Wikipedia. Wikimedia Foundation. ...

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

Designing Data-Intensive Applications, 2nd Edition

Designing Data-Intensive Applications, 2nd Edition

Martin Kleppmann, Chris Riccomini

Publisher Resources

ISBN: 9780136905776