Courses
Playgrounds

C++ Fundamentals

30 lessons8 exercisescpp

A practical course in C++ that teaches you C++ from first principles. No prior experience with C++ is expected.

Who this is for

Beginners with no prior experience. Beginners with no prior experience. Beginners with no prior experience.

Start Course

Course Description

Welcome to the world of high-performance programming! This course is designed to take you from the foundational concepts of software development straight into the heart of C++, one of the most powerful and enduring programming languages ever created. Developed by Bjarne Stroustrup as an extension of the C language, C++ blends the raw speed and hardware-level control of low-level languages with the sophisticated abstraction of modern, object-oriented programming. Whether your goal is to build cutting-edge game engines, develop high-frequency trading applications, or program embedded systems, mastering C++ will give you a profound understanding of how software interacts with hardware.

Throughout this journey, you will move beyond just writing code that “works” to writing code that is highly optimized and robust. We will explore the core pillars of the language, beginning with basic syntax and memory management, before diving deep into Object-Oriented Programming (OOP) principles like inheritance, polymorphism, and encapsulation. You will also unlock the power of the Standard Template Library (STL), which provides a rich set of ready-to-use containers, iterators, and algorithms, allowing you to solve complex computational problems with elegance and efficiency.

What truly sets C++ apart—and makes this course so rewarding—is its philosophy of “zero-cost abstraction.” You will learn how to write high-level, expressive code without sacrificing runtime performance or bloated compiled binaries. By the end of this course, you won’t just know the syntax of C++; you will have developed a “programmer’s mindset,” equipped with the problem-solving skills and pointer discipline required to tackle engineering challenges at any scale. Get ready to control every byte and unleash the full potential of your machine!

Table of Contents

30 lessons · 8 exercises

Getting Started
01
What is C++ and Where It’s UsedUnderstand what C++ is, where industry uses it, and why its performance and hardware control set it apart.
02
Anatomy of a C++ Program: main, Includes, NamespacesUnderstand the structure of every C++ program: the main function, includes, and the std namespace.
03
How a C++ Program is Compiled and RunUnderstand how C++ transforms source code into a running program through the preprocessor, compiler, and linker.
04
Comments, Whitespace, and Code Style BasicsWrite more readable C++ code using comments, whitespace, and indentation to express intent and structure.
Variables and Data Types
05
Variables and declarationsLearn how to declare, initialize, and assign variables in C++, and write readable code with proper naming conventions.
06
Fundamental Types: int, double, char, boolLearn the four core C++ value types, int, double, char, and bool, and what it means for a language to be statically typed.
07
Integer and Floating-Point Variants: Size, Sign, and PrecisionLearn about C++ numeric types and choose the right integer or floating-point type to avoid overflow, precision loss, and subtle bugs.
08
Literals and constLearn what literals are in C++, how their types are determined, and how to use const to declare unchangeable named values.
09
Type Deduction with autoLearn how C++ uses auto to deduce variable types at compile time, keeping code concise without sacrificing static typing.
10
Checking Type Sizes and Limits in C++ (sizeof, <limits>)Use sizeof and numeric_limits in C++ to check a type’s exact size and value range on any platform.
11
Type Conversions and Casting in C++Distinguish implicit widening from narrowing conversions in C++ and cast explicitly with static_cast.
Operators and Expressions
12
Arithmetic OperatorsLearn how C++ arithmetic operators work, including integer truncation in division, the modulo operator, and operator precedence.
13
Assignment Operators and ExpressionsMaster C++ compound assignment operators and learn how assignment itself is an expression, enabling chained assignments.
14
Comparison and Logical OperatorsMaster C++ comparison and logical operators, understand how they produce bool values, and learn to combine them into precise expressions.
15
Bitwise OperatorsManipulate individual bits in C++ using AND, OR, XOR, NOT, and shift operators with bitset output.
16
Increment and Decrement: Pre vs. PostUse C++’s pre- and post-increment operators correctly and avoid the bugs that come from mixing them.
Input and Output
17
Reading Input with std::cin and std::getlineLearn to read user input in C++ using std::cin and std::getline, and handle the common pitfall of mixing the two.
18
Stream Manipulators and FormattingLearn how to format numbers and text output in C++ using stream manipulators for alignment, decimal places, and padding.
Control Flow
19
Conditional Branching (if, else if, else)Learn to control program flow in C++ using if, else if, and else branching logic.
20
Switch StatementsLearn how switch statements compare an expression against multiple values in C++, avoiding messy if/else chains.
21
Ternary OperatorWrite single-line conditional expressions in C++ using the ternary operator instead of if/else.
22
While And Do-While LoopsLearn to repeat code with C++’s while and do-while loops, and know when to use each one.
23
Classic for LoopMaster the three-part structure of C++’s for loop, from counting and skipping to variable scope.
24
Loop Flow: break, continue, Nested LoopsControl loop flow in C++ using break and continue, and handle nested loop exits correctly.
Functions
25
Defining and Calling FunctionsLearn to define C++ functions with return types, parameters, and calls that reuse logic across a program.
26
Pass By Value vs. By ReferenceLearn how to pass arguments in C++, by value and by reference, and how each affects your original variable.
27
Default ArgumentsSkip repetitive arguments in C++ functions by assigning default values that callers can override
28
Function OverloadingWrite multiple C++ functions sharing one name, letting the compiler pick the version matching the call.
29
Scope, Lifetime, and Storage DurationLearn how C++ scope, lifetime, and storage duration decide when a variable is visible, alive, and destroyed.
30
RecursionLearn how to write recursive C++ functions, trace their call stack, and convert tail recursion into loops.
Share

Frequently Asked Questions

Do I need prior experience?

No prior experience needed. Just need to know about int and class and float etc etc.

What will I gain.

Nothing. for a is fine, then b is not fine.

#include <iostream>sdfasdf    sfasdff