Small exercises and experiments on the C++ language.
Each exercise tries to cope some core aspect of the language, but focused on how to solve problemas using it.
Complexity will grow with each exercise, and the background history as well. It's the same formula from my golang handbook.
Think about C++ is to think about the computer history itself. The language predates the internet and was born to ease the task of writing core things, like operating systems and network stacks. There is one standard, yet there are many idioms, many libraries, many compilers.
The language is still evolving. And yet it still holds great retrocompatibility with C language. This is both the blessing and the curse of C++.
We are covering at least the following topics:
- Hello world
- Basic input (environment, arguments, interactive)
- Primitive types
- Basic control flow structures
- Functions
- Pointers
- Basic IO (files)
- Modularity (how to separate and organize code)
- Custom types and Classes
- Templates
- Compilation and compilers
- Project structure
- Other noteworthy libraries
- Intermediate IO (socket networking)
- Concurrency (threads)
- Cross-Compiling
It is a quite easy task to talk bad about C++. The time the language took to evolve and offer basic things didn't help either.
But it's flexible and modern, actively evolving, adding modern features without lose the compatibility with C or 'the past'.
This guide was mostly written and tested on Fedora Linux, with either gcc or clang compilers. However, it is supposed to be possible to run those exercises in any operating system with a standard C++ compiler and runtime library.
Each exercise has a README with specific context and instructions on how to build and run the sample code. Sometimes it's just a single source file, sometimes a more structured project.