This repository contains my personal solutions to the exercises from Bjarne Stroustrup’s book Programming: Principles and Practice Using C++, 3rd (2024) edition.
Disclaimer • These are my own solutions, created while learning and practicing the material. • They are not meant to be a perfect or authoritative guide. • The solutions follow the progression of the book, so: • Exercises in earlier chapters may not always reflect the best or most idiomatic C++ practices learned later. • Even if some solutions are not “ideal” in hindsight, they are still valid and functional within the context of the chapter they belong to.
Ongoing Work • I will continue to add solutions for the remaining chapters as I progress through the book. • Some existing solutions may also be refined or improved over time as my understanding of C++ deepens.
Technical Notes • All code follows the C++20 standard. • Solutions were compiled and run in a Visual Studio Code environment on macOS. • Example compile & run command: g++ -std=c++20 -g path/to/file.cpp -o output_name && ./output_name - Replace path/to/file.cpp with the file you want to compile. - Replace output_name with the name you want for the executable. • Compile & Run (Windows, using MinGW or similar) g++ -std=c++20 -g path\to\file.cpp -o output_name.exe .\output_name.exe
The repository is organized by chapter: . ├── Ch1/ # Solutions for Chapter 1 ├── Ch2/ # Solutions for Chapter 2 ├── Ch3/ # Solutions for Chapter 3 │ ├── exercise_1.cpp │ └── ... ├── Ch4/ # Solutions for Chapter 4 │ └── ... ├── Ch5/ # Solutions for Chapter 5 │ └── ... ... ├── ChXX/ # Future chapters as I progress └── README.md