Key Concepts

Review core concepts you need to learn to master this subject

C++ cout

cout << "Enter your address:";

cout is used to display the output to the standard output. It is followed by the symbols <<, which is then followed by the value to display to the standard output.

C++ Strings

cout << "Enter your address:";

The escape sequence \n (the backslash character followed by letter n) will generate a newline, in a C++ string.

Terminating statements in C++

cout << "Enter your address:";

In C++, the semicolon ; is used to terminate a statement. Every statement in C++ must be ended with a semicolon (;), and failing to do so will result in errors thrown by the compiler.

Case sensitivity in C++

cout << "Enter your address:";

C++ is case sensitive for language keywords and variable names.

Single Line C++ Comments

cout << "Enter your address:";

Comments make the code more readable for others.

In C++ , a comment starts with two forward slashes //, called a single-line comment.

The two slashes order the compiler to ignore everything that follows until the end of the line.

The code example will ignore the // single-line comment and prints the Hello world statement.

Chevron Left Icon
Hello World
Lesson 1 of 2
Chevron Right Icon
  1. 1

    There are only two kinds of languages: the ones people complain about and the ones nobody uses. C++ is a programming language created by Bjarne Stroustrup and his team at Bell Laboratories…

  2. 2

    Take a look at the hello.cpp file in the middle of the screen. It’s a C++ program! In our text editor, you can find the file name at the top: File C++ “pr…

  3. 3

    High five! We just got your first C++ program to run! C++, like most programming languages, runs line by line, from top to bottom. Here is the structure of a C++ program: In between the curl…

  4. 4

    We learned how to output a line of text with the following code: […] It will output: […] We can also output multiple lines by adding more […] statements: […] This will output:…

  5. 5

    Woohoo! You have written your first C++ programs!  –> In this lesson, you have learned: - C++ is a general purpose coding language. - C++ runs line by line, from top to bottom. - […] is h…

  1. 1

    C++ is a compiled language. That means that to get a C++ program to run, you must first translate it from a human-readable form to something a machine can “understand.” That translation is done by …

  2. 2

    Compile: A computer can only understand machine code. A compiler can translate the C++ programs that we write into machine code. To compile a file, you need to type […] followed by the fi…

  3. 3

    Compile: Sometimes when we compile, we want to give the output executable file a specific name. To do so, the compile command is slightly different. We still need to write […] and the file …

  4. 4

    Programming is often highly collaborative. In addition, our own code can quickly become difficult to understand when we return to it — sometimes only a few hours later! For these reasons, it’s ofte…

  5. 5

    Congratulations!  In this lesson, you have learned: - Compilation and execution using the terminal. […] […] - Single line comments can be created using […] . - Multi-line comments ca…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo