Skip to main content



Using Macros and Command Line Arguments with C++

Image by Christopher Kuszajewski from Pixabay Macros are a very useful feature of the C++ Programming Language that made their first appearance in the C programming language decades ago in the early years of Unix and C. Macros can be used equally well in either C++ or C. Macros allow a developer to designate constant values and also to create function like constants that can handle parameters. Macros are resolved at compile time to their definition, and are usually designated by all capital letters, which is the normal style for them. In this blog post, we will build a simple C++ program demonstrating the use of macros, and also, demonstrating the use of command line arguments. In the early years of C programming on Unix operating systems, then later with C++, before the appearance of Graphical User Interfaces (GUIs) , programs were run from the Unix command line, commonly referred to as the CLI. Using Macros for Simple Constants A good de

Latest Posts

Step by Step USB Install of OpenBSD Unix

Simple Email Spam Filtering with Microsoft C# .NET and JQuery

Managing Linux and Unix Servers Remotely with the Termux Android App

Comparison of Lists in C++, Microsoft C# .NET, and other Programming Languages