C++ Learning Programme (3 Months)
This programme is designed to refresh your C++ knowledge, focusing on understanding complex code and writing simple code by the end of the programme. It is split into 3 phases, each lasting 1 month, with corresponding exercises, resources, and goals.
Phase 1: Fundamentals and Syntax Refresh
Duration: 4 weeks
Goal: Relearn C++ syntax, basic constructs, and simple problem-solving.
Topics to Cover:
C++ basic syntax (variables, data types, control structures)
Functions, pointers, references
Object-Oriented Programming (OOP): Classes, inheritance, polymorphism
Memory management (stack vs heap)
Basic input/output operations (streams)
Resources:
-
-
Book: “Programming: Principles and Practice Using C++” by Bjarne Stroustrup (optional)
Exercises:
Simple console applications (calculators, loops, conditionals)
Rebuild classic data structures (linked list, stack, queue) using C++
Implement small OOP examples (e.g., a simple class hierarchy with inheritance)
Projects:
Write a small program to manage basic bank transactions (using classes and file I/O)
Duration: 4 weeks
Goal: Dive deeper into intermediate C++ topics and master the Standard Library (STL).
Topics to Cover:
Templates and Generic Programming
Standard Template Library (STL): Vectors, Lists, Maps, Sets
Error handling (exceptions)
Smart pointers (unique_ptr, shared_ptr)
Basic Multithreading (std::thread, mutex)
Resources:
-
-
Book: “Effective Modern C++” by Scott Meyers (optional but highly recommended for modern C++ practices)
Exercises:
Implement data structures using STL (e.g., using `std::vector`, `std::map`)
Create simple template classes/functions
Experiment with `std::thread` and `mutex` to manage simple multithreading tasks
Projects:
Write a program that simulates a small library system, using STL containers and smart pointers
Practice using exceptions for error handling in more complex scenarios
Phase 3: Advanced Concepts and Code Reading
Duration: 4 weeks
Goal: Get comfortable with more advanced C++ concepts, focus on reading and understanding complex codebases.
Topics to Cover:
Lambda functions and functional programming
Move semantics and R-value references
Advanced memory management (manual allocation and deallocation)
Reading and contributing to open-source C++ projects
Debugging and profiling C++ code
Exercises:
Analyze complex C++ code in open-source projects (focusing on reading, not just writing)
Solve more complex coding challenges using C++ (check websites like LeetCode, Codeforces)
Debug C++ programs and profile performance using tools like `gdb` and `valgrind`
Projects:
Contribute small patches or improvements to open-source C++ projects
Implement a simple task scheduler or a basic version of a task queue using C++ threads
IDE/Editor:
Recommended: Visual Studio Code with the C++ extension, or CLion
Compilers:
GCC (Linux) or Clang
For Windows: MinGW or MSVC
Get familiar with using CMake for project management and building larger C++ projects.
End of Programme Goal
At the end of this 3-month programme, you should be able to:
Read and understand moderately complex C++ codebases
Write simple C++ programs using modern C++ practices (C++11/14/17)
Feel comfortable contributing to open-source C++ projects or debugging complex C++ applications.