C++ – How to Parse Command Line Arguments

In this tip I want to show a quick way (one of many) for parsing command line arguments using C++17. A quick way of parsing command line arguments in modern C++-17 for non-production without using third party header files / libraries. For real world projects, a third party approach is more encouraged. Background Very often, …

Memory Alignment & Padding

What is meant with “memory alignment” ? The CPU (memory controller) access the memory by a single word in time. The next examples are the simplified illustration of the background problem: Say for example that the data fits and is aligned within the single word, like in the following image: In this case the data …

CMake – Make it Simple – Part I

About CMake Visual Studio Project without CMake Makefile project without CMake Using CMake About CMake This is the first part of the cmake tutorial. It is aimed to the absolute beginners and tries to explain the cmake principle in simple terms. I assume that you already now how to write programs. I also assume that …

C++ Lambda’s – simply explained

The C++-11 brought lambda expressions, which are a convient way of defining clojures. Before C++-11 a typical way to pass function-like objects to algorithms was to define a class/struct with operator()(…). For example for sorting vector of pairs of 2 integers by the value of the second element would in C++98 look something like: Since …