SrcForge C++ Tutorial Hub
Learn C++ through focused lessons, one topic at a time.
Start with the basics and move through syntax, data types, pointers, and references in a clean tutorial flow.
Navigation
Use the module cards below to jump directly into any topic.
C++ course enrollment
Enroll to save your C++ progress.
Track completed lessons, resume from your dashboard, and keep your C++ course progress synced to your account.
68 trackable lessons
Modules
Choose a module to start learning
Foundation
Getting Started with C++
What C++ is, how it differs from C, and how source code becomes a program.
Lesson 1
Introduction
Learn Introduction to C++ in C++ programming, its history, features, applications, syntax, examples, and best practices with beginner-friendly explanations and diagrams.
Open lessonLesson 2
C vs C++ Comparison
Compare C and C++. Covers history, features, syntax, and use cases.
Open lessonLesson 3
Structure of a C++ Program
Learn the basic structure of a C++ program with examples.
Open lessonLesson 4
Compiling and Executing
Learn how C++ programs are compiled and run.
Open lessonSyntax Basics
The building blocks of a C++ program: types, tokens, expressions, and input/output.
Lesson 5
Data Types
Learn C++ data types with examples.
Open lessonLesson 6
Variables and Constants
Learn C++ variables and constants with examples.
Open lessonLesson 7
Operators and Expressions
Learn C++ operators and expressions.
Open lessonLesson 8
Tokens
Learn C++ tokens with examples.
Open lessonLesson 9
Basic I/O
Learn cin and cout for C++ input and output.
Open lessonLesson 10
Manipulators
Format C++ output with manipulators.
Open lessonControl Flow & Functions
Branching, looping, arrays, strings, scope, and the basics of reusable logic.
Lesson 11
Control Structures
Learn if, else, switch in C++.
Open lessonLesson 12
Looping Statements
Learn for, while, do-while loops in C++.
Open lessonLesson 13
Arrays
Learn arrays in C++ with examples.
Open lessonLesson 14
Strings
Learn C++ strings with examples.
Open lessonLesson 15
Functions
Learn C++ functions with examples.
Open lessonLesson 16
Boolean
Learn bool type in C++ with examples.
Open lessonLesson 18
Scope of Variables
Learn scope of variables in C++ with local, global, block scope, and shadowing.
Open lessonLesson 19
Storage Classes
Learn storage classes in C++ including auto, register, static, and extern.
Open lessonIntermediate
Pointers, Memory & Data
Pointers, references, memory allocation, files, and lower-level language mechanics.
Lesson 17
RAII (Resource Acquisition Is Initialization)
Learn RAII in C++ for automatic resource management and exception safety.
Open lessonLesson 20
Pointers
Learn pointers in C++ including memory addresses, dereferencing, and pointer arithmetic.
Open lessonLesson 21
Memory Diagrams for Pointers
Learn Memory Diagrams for Pointers in C++ with visual explanations, step-by-step examples, and fully commented code for beginners.
Open lessonLesson 22
References
Learn References in C++ with syntax, rules, examples, comparisons with pointers, best practices, common mistakes, and FAQs for beginners.
Open lessonLesson 23
Structures and Unions
Learn Structures and Unions in C++ with syntax, differences, memory layout, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 24
Dynamic Memory (new/delete)
Learn Dynamic Memory (new/delete) in C++ with syntax, memory diagrams, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 25
File Handling
Learn File Handling in C++ with ifstream, ofstream, and fstream. Understand reading, writing, appending, file modes, examples, common mistakes, best practices, and FAQs.
Open lessonLesson 26
Math Library
Learn Math Library in C++ with <cmath> functions, syntax, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 27
Function Overloading
Learn Function Overloading in C++ with syntax, rules, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 58
Advanced Pointers
Learn Advanced Pointers in C++ with clear explanations, practical examples, common mistakes, best practices, and real-world applications.
Open lessonLesson 59
Recursion
Learn Recursion in C++ with simple explanations, syntax, examples, common mistakes, best practices, and real-world use cases.
Open lessonLesson 60
Enums and Typedef
Learn Enums and Typedef in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 61
Preprocessor Directives
Learn Preprocessor Directives in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonClasses & OOP
Classes, object lifetime, inheritance, polymorphism, exceptions, and namespaces.
Lesson 28
Classes and Objects
Learn Classes and Objects in C++ with syntax, constructors, member functions, access specifiers, examples, common mistakes, best practices, and FAQs.
Open lessonLesson 29
Constructors and Destructors
Learn Constructors and Destructors in C++ with syntax, types, examples, lifecycle, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 30
Inheritance
Learn Inheritance in C++ with syntax, types of inheritance, access modes, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 31
Polymorphism
Learn Polymorphism in C++ with virtual functions, function overloading, overriding, runtime vs compile-time polymorphism, examples, common mistakes, best practices, and FAQs.
Open lessonLesson 32
Operator Overloading
Learn Operator Overloading in C++ with syntax, rules, examples, common mistakes, best practices, and FAQs. Master compile-time polymorphism through operator overloading.
Open lessonLesson 33
Exception Handling
Learn Exception Handling in C++ with try, throw, catch, custom exceptions, examples, common mistakes, best practices, and FAQs for beginners.
Open lessonLesson 34
Namespaces
Learn Namespaces in C++ with syntax, using directive, aliasing, nested namespaces, examples, common mistakes, best practices, and FAQs.
Open lessonTemplates & Generic Programming
Build reusable, type-safe code with templates and generic programming concepts.
Advanced
STL Containers
Vectors, sets, maps, queues, stacks, and the containers you will use most often.
Lesson 36
Vector
Learn STL Vector in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 37
Set
Learn STL Set in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 38
Map
Learn STL Map in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 39
Unordered Set
Learn Unordered Set in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 40
Unordered Map
Learn Unordered Map in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 41
List
Learn STL List in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 42
Deque
Learn STL Deque in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 43
Queue
Learn STL Queue in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 44
Stack
Learn STL Stack in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 45
Priority Queue
Learn Priority Queue in C++ with beginner-friendly explanations, syntax, operations, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonSTL Algorithms & Performance
Fast I/O, iterators, algorithms, and the performance habits that matter in practice.
Lesson 46
Fast I/O Techniques
Learn Fast I/O Techniques in C++ with beginner-friendly explanations, optimization methods, fully commented examples, common mistakes, best practices, FAQs, and competitive programming tips.
Open lessonLesson 52
STL Algorithms and Iterators (part 1)
Learn STL Algorithms and Iterators in C++ with beginner-friendly explanations, syntax, iterator types, and fully commented code examples.
Open lessonLesson 53
STL Algorithms and Iterators (part 2)
Learn the most commonly used STL algorithms in C++ along with reverse iterators and const iterators, with beginner-friendly explanations and fully commented code examples.
Open lessonLesson 54
STL Algorithms and Iterators (part 3)
Learn the most common mistakes, best practices, algorithm complexity, and a quick-reference cheat sheet for writing correct, efficient STL Algorithms and Iterators code in C++.
Open lessonModern C++ Features
Smart pointers, move semantics, lambdas, and the standards that shaped modern C++.
Lesson 47
Smart Pointers
Learn Smart Pointers in C++ with beginner-friendly explanations, types (unique_ptr, shared_ptr, weak_ptr), syntax, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 48
Move Semantics
Learn Move Semantics in C++ with beginner-friendly explanations, rvalue references, std::move(), move constructors, move assignment operators, fully commented examples, common mistakes, best practices, FAQs, and real-world use cases.
Open lessonLesson 49
Lambda Expressions (part 1)
Learn Lambda Expressions in C++ with syntax, examples, captures, and best practices. A beginner-friendly guide with fully explained code examples.
Open lessonLesson 50
Lambda Expressions (part 2)
Learn advanced Lambda Expressions in C++ with STL algorithms, generic lambdas, capturing everything, returning lambdas, recursive lambdas, fully commented examples, common mistakes, best practices, and real-world use cases.
Open lessonLesson 51
Lambda Expressions (part 3)
Learn how Lambda Expressions in C++ compare to regular functions and functors, review key takeaways, and get answers to common beginner FAQs with fully explained code examples.
Open lessonLesson 68
C++11/14/17/20 Features Overview
Learn C++11/14/17/20 Features Overview with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonDebugging, Systems & Concurrency
Threads, debugging, build tooling, and the reliability issues you have to handle.
Lesson 55
Multithreading (part 1)
Learn Multithreading Basics in C++ with simple explanations, std::thread examples, thread lifecycle, and fully commented code examples for beginners.
Open lessonLesson 56
Multithreading (part 2)
Learn how threads communicate in C++, including passing arguments, race conditions, mutexes, lock_guard, and deadlocks, with fully commented code examples.
Open lessonLesson 57
Multithreading (part 3)
Learn advanced multithreading tools in C++ including condition variables, atomic variables, the producer-consumer pattern, common mistakes, best practices, and a handy cheat sheet.
Open lessonLesson 62
Debugging with GDB
Learn Debugging with GDB in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 63
Segfault Debugging
Learn Segfault Debugging Walkthrough in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 64
Memory Leak Detection
Learn Memory Leak Detection in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 65
Dangling Pointers
Learn Dangling Pointers in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 66
Makefiles
Learn Makefiles in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lessonLesson 67
Undefined Behavior
Learn Undefined Behavior in C++ with simple explanations, syntax, examples, best practices, common mistakes, and real-world use cases.
Open lesson