CS 70

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.
  • LHS Cow speaking

    There's a lot going on with numeric types in C and C++!!

Outline

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.)