Skip to main content

Command Palette

Search for a command to run...

Macro in C

Updated
•1 min read•View as Markdown
R
I am a Systems Engineer with experience in leveraging a variety of technologies to find the easiest and most efficient and effective way to meet the needs of the project's requirements. I like to build software and systems to help ease mundane and complex tasks.

What is a macro?

A macro is a text replacement rule defined with #define that swaps names for text before the compiler runs.

For Example:

#define PI 3.14159

Every time you write "PI" in your code, the preprocessor replaces it with 3.14159.