Lesson 2
By the end of this lesson, you should be able to list the stages of a primitive, local variable’s lifetime. You should also be able to recognize safe and unsafe promotion and conversion between numeric types.
Learning Goals
This lesson addresses the following course-learning goals from Group 1: Numeric Types and Memory Models:
- Goal 1B (Numeric Types Fundamentals): List the fundamental C/C++ integer types in order of (potentially) increasing size (and likewise for floating-point types). Observe that different computing platforms adopt different memory models. Highlight the key differences between unsigned and signed integers.
- Goal 1C (Promotion and Conversion): Identify when promotion & conversion happen between numeric types.
- Goal 1D (Using Numeric Types): Recognize common errors in the use of these types. Choose numeric types appropriately for their intended use.
There's a lot going on with numeric types in C and C++!!
Outline
- Before You Start…
- Object Lifetime
- Loops and Conditionals with Object Lifetime
- Numeric Types — Fundamentals
- Numeric Types — Promotion and Conversion
- Numeric Types — Advice and Common Errors
- Key Points
- Before You Go…
To receive credit: complete all pages above, then this page will be complete as well (and get a green check emoji at the bottom right of the page).
(When logged in, completion status appears here.)