C++ lessons
Power and performance
C++ was created in 1985 by Bjarne Stroustrup by adding object-oriented programming on top of C. It retains C's speed and hardware control while adding classes, templates, and a rich standard library. The ++ in its name implies that it is the "incremented" version of C.
C++ lives today where performance is non-negotiable: games written with Unreal Engine, heavy desktop applications like Adobe and Autodesk, browser engines, financial transaction systems, and image processing libraries.
The most challenging part of the language is its size. C++ has grown layer by layer over decades; there are several different ways to do the same thing, and some are no longer recommended. That's why learning modern C++ is important: such as using smart pointers instead of writing manual new and delete, and using vector instead of a raw array.
- •→
Introduction to C++
First step into C++, the language of power and performance: program structure, printing with cout, and variables.
- •→
Variables
int, double, string, bool types; type deduction with auto, and const constants.
- •→
Data Types
int, double, char, bool, string; type conversion (casting and stoi).
- •→
Operators
Math (+ - * / %), comparison (== < >), and logic (&& || !).
- •→
Strings
std::string concatenation, length, substr and find.
- •→
Vectors (vector)
Flexible arrays: traversing with push_back, size, [] and range-for.
- •→
Conditions (if / switch)
Making decisions with if-else, else if, and switch.
- •→
Loops (for / while)
Definite repetition with for and conditional repetition with while.
- •→
Functions
Function definition, parameter/return types and parameter by reference (&).
- •→
Classes (OOP)
class, public members, constructor, methods and object creation.
What you will learn
- doing input and output with cout and cin
- the difference between variables, references, and pointers
- the concepts of classes, objects, constructors, and destructors
- polymorphism with inheritance and virtual functions
- standard library containers like vector, map, and string
- writing type-independent code with templates
- managing memory safely with smart pointers
Who is this for?
- those leaning toward game development, especially on the Unreal Engine side
- those who will write desktop or system software requiring high performance
- those preparing for algorithmic competitions — C++ is the dominant language in this field
When to use?
C++ is the right choice for game engines, real-time graphics, financial transaction systems, image and signal processing, and large desktop applications.
It is too costly for web backends, automation scripts, or data analysis; development time is multiples of its Python counterpart for the same task. In new system projects, Rust can offer similar performance with fewer memory errors.
Frequently asked questions
Can I learn C++ without knowing C?
Yes, in fact, some instructors recommend it: modern C++ uses its own containers and smart pointers, and does not need the manual memory management habits of C. Still, knowing C makes it easier for you to understand what is happening underneath.
Why am I being told not to use using namespace std?
This line dumps all names in the standard library into the global scope; if a name you write clashes with one in the library, hard-to-understand errors will occur. It's not a problem in a small exercise, but in a multi-file project, typing the std prefix is safer.
Should I use a reference or a pointer?
When passing an object to a function and you are sure that object exists, a reference is simpler and safer. If there is a possibility that it could be null, or if you want to change what you are pointing to later, a pointer is needed. Practical rule: try the reference first, don't switch to a pointer unless necessary.
What is a smart pointer, why is it necessary?
Classes like unique_ptr and shared_ptr automatically return the memory you allocated when it goes out of scope. This eliminates leaks caused by forgetting to write delete. Writing manual new and delete in modern C++ code is an exceptional case.
Summary
C++ combines C's performance with object orientation and a powerful standard library; it is the primary language of the gaming and high-performance world. In this training, we start with cout and progress all the way to classes, templates, and smart pointers.