https://github.com/diniremix/cpp-examples
Simple exercises for learning modern C++ [C++ 20 and up](https://isocpp.org/).
https://github.com/diniremix/cpp-examples
beginner-friendly c-plus-plus cpp cpp20 cpp23 exercises
Last synced: about 21 hours ago
JSON representation
Simple exercises for learning modern C++ [C++ 20 and up](https://isocpp.org/).
- Host: GitHub
- URL: https://github.com/diniremix/cpp-examples
- Owner: diniremix
- License: apache-2.0
- Created: 2026-06-09T16:32:25.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-07-04T22:16:06.000Z (22 days ago)
- Last Synced: 2026-07-05T00:08:43.076Z (22 days ago)
- Topics: beginner-friendly, c-plus-plus, cpp, cpp20, cpp23, exercises
- Language: C++
- Homepage:
- Size: 228 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# CPP exercises
Simple exercises for learning modern C++ ([C++ 20 and above](https://isocpp.org/)).
## Requirements
- [GCC](https://gcc.gnu.org/) **13.3.x** and above
- [vcpkg](https://vcpkg.io/en/) **2026-05-27** and above
- [Cmake](https://cmake.org/download/) **3.28.x** and above
- [Ninja](https://ninja-build.org/) **1.11.x** and above
## Recommended tools
- [xmake](https://xmake.io/) **3.0.6.x** and above
- [just](https://github.com/casey/just) **1.47.x** and above
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html)
- [clang-tidy](https://clang.llvm.org/extra/clang-tidy/)
- [clangd (lsp)](https://clangd.llvm.org/)
## Getting Started
### Clone the repo and make it yours:
```bash
$ git clone git@github.com:diniremix/cpp-examples.git
```
```bash
$ cd cpp-examples
```
### Install dependencies
```bash
$ vcpkg install
```
### Configure
```bash
$ just configure
# cmake --preset debug
```
### Build
```bash
$ just build
# cmake --build --preset debug -j
```
### Run exercise
```bash
$ just ex EXERCISE_NAME
# cmake --build --preset debug --target EXERCISE_NAME -j
# ./build/debug/EXERCISE_NAME
```
## Tutorials
create a new example:
```bash
$ just new EXERCISE_NAME
```
Then add the following line to `cmake/Exercises.cmake`:
```cmake
add_exercise(EXERCISE_NAME)
```
Finally, run:
```bash
$ just ex EXERCISE_NAME
```
## tested on
| O.S. | compiler |
| -------------------- | ---------------------------- |
| Ubuntu 24.04 | (GCC 13.3.0) |
| Fedora 44 | (GCC 16.1.1) |
| Windows 11 | (MSVC 19.44.35226 for x64) |
## License
**CPP examples** is licensed under either of the following licenses, at your option:
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0])
- MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT])