o‘zing o‘rgan
C++ Basics Lesson 1 / 19
Pito

What C++ is and where it's used

A fast language: games, browsers, robots; compilation; where to practise

Chapter 1. C++ basics 15 minutes 4 questions

C++ is a fast programming language that lets you control the computer's memory directly. It was created by the Danish computer scientist Bjarne Stroustrup as an extension of C; its first official release came out in 1985.

Where it's used

Field Example
Games the Unreal Engine game engine is written in C++
Browsers large parts of Chrome and Firefox
Robotics and devices code for Arduino boards is based on C++
Where speed matters financial systems, databases, 3D graphics
Competitions one of the most popular languages in programming olympiads

How it differs from Python

Python C++
Running an interpreter — line by line compilation: first turned into machine code
Speed slower much faster
Types x = 5 — type is automatic int x = 5; — the type is written out
End of statement a new line a ; semicolon
Blocks indentation { } curly braces

Compilation

program.cpp  ──g++──▶  program (an executable file)  ──▶  output
  1. You write the code in a program.cpp file.
  2. The compiler (g++) turns it into machine code: g++ program.cpp -o program
  3. You run the resulting file: ./program (program.exe on Windows).

If there's a mistake, the compiler tells you before the program runs — one of C++'s strengths.

Where to practise

This site's editor doesn't run C++ — the examples and their output are shown in the lesson. To practise yourself:

  • On your computer: g++ via MinGW-w64 or WSL (Ubuntu) on Windows; VS Code or Code::Blocks as the editor.
  • Online: free in-browser online compilers (for example OnlineGDB or Compiler Explorer) — nothing to install.

💡 If you know Python, C++ is much easier: loops, conditions and functions are the same ideas — just written more strictly.

Check yourself

Question 1 / 4

How is a C++ program run?

Choices

Question 2 / 4

How does a statement end in C++?

Choices

Question 3 / 4

Who created C++?

Choices

Question 4 / 4

Which of these is a typical use of C++?

Choices