Introduction to C++
C++ is a programming language for writing fast programs. Many game engines, web browsers and databases are written in C++. People choose it when a program must run quickly and use the computer's memory carefully.
C++ was created by Bjarne Stroustrup at Bell Labs in the early 1980s. He started from an older language called C, which was already known for speed. Then he added tools that help you organize big programs, such as classes. The name is a small joke: in C, ++ means "add one", so C++ means "C, plus one more step".
C++ is a compiled language
The computer cannot run C++ code directly. It only understands machine code, a long list of very simple instructions. A program called a compiler translates your C++ code into machine code first. After that, the machine code runs.
Compiled programs run fast, because the translation is done before the program starts. But it also means that if your code breaks a rule of the language, the compiler shows an error, and no part of your program runs. You will see these errors soon, and you will learn to read them.
Your first C++ program
Here is a complete C++ program:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, C++!" << endl;
return 0;
}
Output:
Hello, C++!
The line with cout prints the text between the double quotes. Do not worry about the other lines yet. The next lesson explains every line of this program.
C++ is known as a hard language. The full language is very large, but you only need a small part of it to write real programs. That part is what this course teaches, one step at a time, with an exercise after every lesson.
Your first exercise is already complete. Hit Submit and watch C++ print the same greeting.