1.3: Basics of C++
1.3.1: Introduction to C++
Read this article about the structure of C++ programming. Then, compile the example in the article and make sure you understand the code in each line.
1.3.2: Variables, Data Types, and Constants
Read this article about data types. Although this discusses C, the data types in C++ are exactly the same, except that C does not include a boolean variable. For now, just note that a boolean variable holds a value of either True or False.
Watch this video, which explains how data types are used in C++.
1.3.3: Basic Input and Output
Watch this (admittedly robotic) video, which provides an explanation of input and output.
Complete these exercises to check your understanding of input and output.
1.3.4: Control Structures
Read these lecture notes to learn about control structures in C++ programming. Compile the examples from the notes, and make sure you understand the code in each line. After reading these notes, you should be able to define conditional structures, iteration structures, and jump statements.
1.3.5: Simple Functions
1.3.5.1: Scope of Variables in a Function
Read sections 3.3 to 3.10 on pages 23-30, which outline how to use and create functions. Functions are small segments of code that are removed from the normal code flow, and they are called to perform specific actions. After the function executes, control returns back to the normal flow. Within a function, data may be sent and returned to the rest of the program.
1.3.5.2: Arguments Passed by Value and by Reference
Read this article, which explains how data is passed between functions. When data is passed by value, the actual contents of the variable is passed. However, with some data, you may instead simply want the program to access the data directly from the current location where it is stored. To do this, you pass the value by reference, which tells the function to access the address of the variable.
Take these six quizzes in Problem Set 1. After you finish, check your answers against those provided.