A hands-on learning repository for C++ fundamentals, object-oriented programming, and small practical projects. Designed for beginners who want to learn C++ by reading, modifying, and running real code examples.
Maintained by GitGuild.
These videos walk through the concepts covered in this repository. Follow along with the code examples as you watch.
| Topic | Video |
|---|---|
| C++ Full Course (Beginner to Advanced) | YouTube |
| Object-Oriented Programming in C++ | YouTube |
CPP-Starting-from-0/
├── Learning/ # Core C++ concept examples, ordered by topic
├── OOPM/ # Object-Oriented Programming & Modularity examples
├── Basic DSA/ # Data structures (linked lists, and more over time)
└── Projects/ # Mini-projects combining everything learned
Follow the files in order to progress from basics to more advanced concepts.
| # | File | Topics Covered |
|---|---|---|
| 1 | 1First_Steps.cpp |
Output, variables, data types, arithmetic, user input, math functions |
| 2 | 2Conditions.cpp |
if, else if, else, comparison operators |
| 3 | 3StringsAndLoops.cpp |
String manipulation, for loops, while loops |
| 4 | 4Function_Overloading.cpp |
Writing functions, overloading (same name, different parameters) |
| 5 | 5Arrays_and_foreachloop.cpp |
Arrays, range-based for loops |
| 6 | 6MemoryAddresses.cpp |
Pointers, memory addresses, pass-by-reference |
| 7 | 7RecursionsANDStructs.cpp |
Recursion, struct definition and usage |
| 8 | 8OOPS.cpp |
Classes, objects, access modifiers, basic OOP |
| 9 | 9Overloading.cpp |
Operator and function overloading |
| 10 | CollegeOverloading.cpp |
Additional overloading exercises |
| 11 | HigherCollegeOverloading.cpp |
Advanced overloading examples |
| 12 | Matrix.cpp |
2D arrays and matrix operations |
Organized into three phases of increasing difficulty. Complete them in order.
Phase 1 — Fundamentals
| File | Topics Covered |
|---|---|
Phase 1/1Classes and Objects.cpp |
Defining classes, creating objects, public members |
Phase 1/2Constructor.cpp |
Constructors, parameterized initialization |
Phase 1/3Encapsulation.cpp |
Getters, setters, encapsulation principles |
Phase 1/4Polymorphism.cpp |
virtual functions, runtime polymorphism, base-class pointers |
Phase 2 — Pillars
| File | Topics Covered |
|---|---|
Phase 2/5Abstraction.cpp |
Abstract classes, pure virtual functions, interfaces, smart pointers |
Phase 2/6Inheritance.cpp |
Base and derived classes, protected, access specifiers, multilevel inheritance |
Phase 2/7Static_Members.cpp |
Static data members, static member functions, class-level state |
Phase 3 — Advanced
| File | Topics Covered |
|---|---|
Phase 3/7Operator_Overloading.cpp |
Making operators (+, ==, +=, -=, <<) work on your own classes |
Phase 3/8Friend.cpp |
Friend functions and friend classes |
Phase 3/9More_About_Constructors.cpp |
Default vs parameterized constructors, copy/move semantics (std::move), releasing owned heap memory |
Phase 3/Error_Handling.cpp |
try/throw/catch, the full std::exception hierarchy, custom exceptions, noexcept |
Phase 3/ErrorHandling.md |
Written reference: exception hierarchy, common error codes, best practices |
Practice
| File | Topics Covered |
|---|---|
Practice/ElecBill.cpp |
Constructor-based initialization in a small program (electricity bill) |
Practice/Operator_Overloading_using_Friend.cpp |
Overloading + for a Complex class with a friend function |
Start after Learning/ files 6–8 (pointers, structs, classes). See Basic DSA/README.md for the full guide, and Basic DSA/Linked List/README.md for the concept deep-dive and verified output of every file.
| File | Topics Covered |
|---|---|
Linked List/BasicLinkedList.cpp |
Manual node creation and linking, class Node vs struct, this, nullptr vs NULL, traversal, freeing the heap with a delete loop |
Linked List/LinkedList.cpp |
The practical approach: wrapping the list in a LinkedList class — constructor for head, add() and print() methods, objects in main |
Linked List/Insertion/InsertAtFirst.cpp |
Node anatomy, head pointer, Node *&head (reference-to-pointer), insert at front O(1), traversal, new, nullptr |
Linked List/Insertion/InsertAtLast.cpp |
Empty-list handling, walking to the last node, append O(n) |
Linked List/Insertion/InsertAtPos.cpp |
1-indexed insertion, bounds checking, splicing nodes |
Linked List/Deletion/delAtBegin.cpp |
Delete at front: empty-list guard, moving head forward before delete, O(1) |
Read them in that order — each file builds on the one before it.
| File | Description |
|---|---|
Banking_program.cpp |
Deposit, withdrawal, and balance checking with input validation |
Credit_CardValidator.cpp |
Luhn algorithm implementation for card number validation |
Quiz.cpp |
Interactive quiz application |
Random_game.cpp |
Number guessing game |
TTT.cpp |
Tic-Tac-Toe game |
- A C++ compiler (GCC, Clang, or MSVC)
- A text editor or IDE (VS Code recommended)
Using g++ (Linux/macOS/MinGW):
g++ Learning/1First_Steps.cpp -o first_steps
./first_stepsUsing VS Code with the C/C++ Extension Pack:
- Install the C/C++ Extension Pack from the VS Code Marketplace.
- Open the folder in VS Code.
- Open any
.cppfile and pressCtrl+F5to run without debugging, orF5to run with debugging.
Using Visual Studio (Windows):
- Create a new Console Application project.
- Replace the generated code with the contents of any
.cppfile. - Press
Ctrl+F5to build and run.
| Extension | Purpose |
|---|---|
| C/C++ Extension Pack | Core C/C++ language support, debugging, and IntelliSense |
| C++ Quick Start Snippets | Common C++ templates and code snippets |
| Code Runner | Compile and run code directly from the editor |
| Code Spell Checker | Catch spelling mistakes in comments and strings |
| Colorful Comments | Highlight special comments like TODO, NOTE for readability |
| Indent Rainbow | Visual indentation guides for easier alignment |
Contributions are welcome. If you have suggestions for new examples or improvements:
- Fork the repository.
- Create a new branch for your changes.
- Add or modify
.cppfiles following the existing naming and structure conventions. - Open a pull request with a clear description of what was added or changed.
This repository is available under the MIT License.