Learn C++
Learn C++ from the ground up: write and compile programs, store data in variables, make decisions, loop, organize data in vectors, write functions and classes, and take control of memory with references and pointers.
- Beginner level
- 8 modules
- 51 lessons
- 182 tasks and questions
Syllabus
01Hello, C++Write your first C++ program, print text with std::cout, add comments, and learn how a compiler turns source code into a program you can run.5 lessons
02Variables and TypesStore values in typed variables, use int, double, char, bool and std::string, do arithmetic, convert between types, and read input with std::cin.6 lessons
03Conditionals and LogicMake your programs choose. Compare values, branch with if, else if and else, pick between cases with switch, and combine conditions with logical operators.7 lessons
04Loops and ErrorsRepeat work with while, do-while and for loops, steer them with break and continue, and learn to recognize compile-time, link-time, runtime and logic errors.7 lessons
05Vectors and ArraysKeep lists of values in std::vector: create, grow and shrink them, loop over their elements, use standard algorithms on them, and see how they compare with built-in arrays and std::array.7 lessons
06FunctionsPackage code into reusable functions. Pass parameters and return results, declare functions before use and split them across files, understand scope, and make functions flexible with default arguments, overloading and templates.7 lessons
07Classes and ObjectsCreate your own types with classes. Give them data members and member functions, protect their data with access specifiers, set them up with constructors, clean up with destructors, and split declarations from definitions.6 lessons
08References and PointersWork directly with memory. Create references and pass arguments by reference, take addresses and dereference pointers, avoid null and dangling pointers, and manage dynamic memory with new, delete and smart pointers.6 lessons