Now that you have a console window open and can write text to it, you're ready for some additional challenges. In this section we will see how certain characters present problems, when written in code. The following videos will demonstrate how we handle these situations.
If you ever look at C++ code online, it won't take you long to discover that there are a couple different ways to create a line break. This video will cover both.
The Standard Namespace
Throughout the semester, you will see "std" in our code. This refers to the "standard" namespace. We'll cover namespaces in more detail, in future chapters.
Review Questions
The following are examples of questions similar to what you can expect to see on the next exam.
-
What is
#include <iostream>
used for? It lets us read and write text to the console. - How do you use an escape character? By using a backslash. Ex: \t is a tab character.
-
What does the code:
using namespace std;
do? Allows us to use functions inside of the standard namespace, without having to prefix them with std::.