My journey in learning C++ started back in 2018. Fast forward to one year later towards the end of 2019, I decided to brush up on the basics again and learn modern practices in C++. I stumbled upon this book and came to realization that there are no online sources that gives solutions to these exercises found at the end of each chapter. Why does it matter? For me, beginners who want to learn programming for the first time, especially a language like C++, won't gain much just by reading the chapters and doing the exercises without knowing if they wrote their code well. It would be nice to supply them with solutions for them to compare their work against others and see if their approach is at least sufficient compared to the solution.
I will like to meantion that I am still learning C++ to this day, and I am working on my undergraduate degree in the meantime. I am no professional nor a beginner.
I will state some facts:
-
I frame from using
printf()
but instead choose to usestd::cout <<
which is the prefer way to write to console output in C++. -
POD types (Plain old data types like
struct
) is what I won't prefer or use; however, I may make an exception for the exercises. If not, I'll use theclass
keyword and prefer data hiding. -
I may or may not use concepts that were not introduced in a following chapter, but I will leave a comment explaining what it means. For example: In chapter 2 exercise, I used the keyword
const
when passing anenum class
object to reframe the idea that it is not intended to be modified but rather be passed as read-only.
Note: On a Linux machine, I placed the catch.hpp file in the default searach path of g++: /usr/include/c++/11
For anyone who is experienced in writing C++ code (or anyone who will like to give tips/advice about this repo), I will gladly accept feedback in what can be done better! :)