/robowaifu/'s C++ learning textbook chapter 04
Computation
“If it doesn’t have to produce correct results, I can make it arbitrarily fast.”. —Gerald M. Weinberg
"This chapter presents the basics of computation. In particular, we discuss how to compute a value from a set of operands (expression), how to choose among alternative actions (selection), and how to repeat a computation for a series of values (iteration). We also show how a particular sub-computation can be named and specified separately (a function). Our primary concern is to express computations in ways that lead to correct and well-organized programs. To help you perform more realistic computations, we introduce the vector type to hold sequences of values."
- § 4.3 Expressions - part a
- § 4.3 Expressions - part b
- § 4.3.1 Constant expressions - part a
- § 4.3.1 Constant expressions - part b
- § 4.3.1 Constant expressions - part c
- § 4.3.1 Constant expressions - part d
- § 4.3.2 Operators
- § 4.3.3 Conversions - part a
- § 4.3.3 Conversions - part b
- § 4.3.3 Conversions - part c
- § 4.3.3 Conversions - part d
- § 4.4 Statements - part a
- § 4.4 Statements - part b
- § 4.4 Statements - part c
- § 4.4.1.1 if-statements - part a
- § 4.4.1.1 if-statements - part b
- § 4.4.1.1 if-statements - part c
- § 4.4.1.1 if-statements - part d
- § 4.4.1.2 switch-statements
- § 4.4.1.3 Switch technicalities - part a
- § 4.4.1.3 Switch technicalities - part b
- § 4.4.1.3 Switch technicalities - part c
- § 4.4.1.3 Switch technicalities - part d
- § 4.4.2.1 while-statements
- § 4.4.2.2 Blocks
- § 4.4.2.3 for-statements - part a
- § 4.4.2.3 for-statements - part b
- § 4.4.2.3 for-statements - part c
- § 4.5 Functions - part a
- § 4.5 Functions - part b
- § 4.5 Functions - part c
- § 4.5.1 Why bother with functions?
- § 4.5.2 Function declarations
- § 4.6 vector - part a
- § 4.6 vector - part b
- § 4.6 vector - part c
- § 4.6 vector - part d
- § 4.6.1 Traversing a vector - part a
- § 4.6.1 Traversing a vector - part b
- § 4.6.2 Growing a vector
- § 4.6.3 A numeric example - part a
- § 4.6.3 A numeric example - part b
- § 4.6.4 A text example