Skip to content

Instantly share code, notes, and snippets.

View SaeedBaig's full-sized avatar
💭
probably in front of a computer

Saeed Baig SaeedBaig

💭
probably in front of a computer
  • Sydney, Australia
View GitHub Profile
@SaeedBaig
SaeedBaig / power_of_macros_in_C.md
Created May 11, 2022 12:06
The Power of Macros in C

The Power of Macros (in C)

A demonstration of the capabilities of macros in C and how/when to use them

First off, what's a macro?

A macro is sort of like a "find and replace" feature that C provides. Its syntax is roughly like this:

#define <text-to-be-replaced> <text-to-replace-with>