Skip to Content
Programming: Principles and Practice Using C++, 3rd Edition
book

Programming: Principles and Practice Using C++, 3rd Edition

by Bjarne Stroustrup
April 2024
Beginner
656 pages
23h 19m
English
Addison-Wesley Professional
Content preview from Programming: Principles and Practice Using C++, 3rd Edition

2

Objects, Types, and Values

Fortune favors the prepared mind.

– Louis Pasteur

This chapter introduces the basics of storing and using data in a program. To do so, we first concentrate on reading in data from the keyboard. After establishing the fundamental notions of objects, types, values, and variables, we introduce several operators and give many examples of use of variables of types char, int, double, and string.

§2.1 Input

§2.2 Variables

§2.3 Input and type

§2.4 Operations and operators

§2.5 Assignment and initialization

An example: detect repeated words; Composite assignment operators; An example: find repeated words

§2.6 Names

§2.7 Types and objects

§2.8 Type safety

§2.9 Conversions

§2.10 Type deduction: auto

2.1 Input

The “Hello, World!” ...

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

Programming: Principles and Practice Using C++, 2nd Edition

Programming: Principles and Practice Using C++, 2nd Edition

Bjarne Stroustrup

Publisher Resources

ISBN: 9780138308667