#045 – The number one mistake beginners make

If you’ve seen this program before in beginner tutorials, you’ll know immediately that the material is out of date What using namespace std; actually does using namespace std; is an example of a using-directive. A using directive tells the compiler to consider every name…

#044 – When to use static local variables

A local variable has local scope. It’s duration is linked to the function it’s defined in. Mark it static and the rules change: the variable persists for the entire program, but its name remains scoped to the function. This article will explore…

#042 – inline is no longer about performance

The inline keyword is one of the most misunderstood features in C++. It once asked the compiler to inline a function for speed; today it does something almost entirely different. tldr: The cost of a function call There is overhead when calling…

#040 – How the std namespace is organized

Ever wondered how <vector>, <string>, and <iostream> all live under the same std namespace without colliding? The answer is a small but elegant C++ rule: identically named namespaces merge at compile time. Understanding this reveals how the Standard Library is modularised — and how you can…

#039 – Building a Binary-to-decimal converter

Introduction A binary number is easy for a computer to store, but not always easy for a human to read. The number 1101 is clear once you know binary, but most people recognise its decimal equivalent, 13, much faster. This Nibble walks through…

#038 – Building a decimal-to-binary converter

This Nibble walks through a small program that converts a positive decimal integer into its binary representation. What the walkthrough covers: The division-by-2 algorithm NOTE: There are other methods to perform decimal to binary conversion. This article is presenting one…

#036 – How bit shifting is used in embedded systems

The bitwise shift operators << and >> move every bit in their left operand a fixed number of positions. They are most often encountered in C++ as overloads for stream I/O, however they are also overloaded to perform bit manipulation. This has widespread use…