Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
C++
4.3K+ articles
C Language
1.8K+ articles
CPP-Functions
615+ articles
C Basics
77+ articles
C++ Quiz
42+ articles
c-puzzle
30+ articles
C-Macro & Preprocessor
18+ articles
Macro & Preprocessor
6+ articles
cpp-macros
11 posts
Recent Articles
Popular Articles
errno constant in C++
Last Updated: 14 August 2021
errno is a preprocessor macro used for error indication.The value of errno is set to zero at program startup, and any function of the standard C++ library are allowed to w...
read more
Misc
C Language
C++
C++ Quiz
DSA
CPP-Functions
cpp-macros
Macro & Preprocessor
Macros and its types in C
Last Updated: 13 May 2025
In C programming, a macro is a symbolic name or constant that represents a value, expression, or code snippet. They are defined using the #define directive, and when encou...
read more
C Programs
C Language
C++
C Macro
cpp-macros
Header Guard in C++
Last Updated: 02 November 2020
Header Guards in C++ are conditional compilation directives that help to avoid errors that arise when the same function or variable is defined more than once by the mistak...
read more
C++ Programs
Programming Language
C++
C++ Quiz
CPP-Basics
cpp-macros
Output of the Program | Use Macros Carefully!
Last Updated: 21 June 2022
Predict the output of the below program C++ #include iostreamusing namespace std;#define square(x) x*xint main() { int x; x = 36 / square(6); cout x; r...
read more
C Language
cpp-macros
C-Output
Interesting Facts about Macros and Preprocessors in C
Last Updated: 10 January 2025
In a C program, all lines that start with # are processed by preprocessor which is a special program invoked by the compiler. by this we mean to say that the ‘#’ symbol is...
read more
C Language
C Basics
cpp-macros
Interesting-Facts
A C Programming Language Puzzle
Last Updated: 21 June 2018
Give a = 12 and b = 36 write a C function/macro that returns 3612 without using arithmetic, strings and predefined functions.We strongly recommend you to minimize your br...
read more
C Language
cpp-macros
cpp-puzzle
C-Macro & Preprocessor
Macros vs Functions
Last Updated: 22 June 2022
A macro is a name given to a block of C statements as a pre-processor directive. Being a pre-processor, the block of code is communicated to the compiler before entering i...
read more
C Language
C++
CPP-Functions
cpp-macros
Difference between #define and const in C
Last Updated: 02 January 2025
In C, both #define and const define constant values, but these constants differ greatly in their behaviors and implementation. #define is a preprocessor directive used to ...
read more
C Language
cpp-macros
C-Macro & Preprocessor
How to print a variable name in C?
Last Updated: 02 January 2025
Printing a variable name means printing the identifier that is assigned to the variable. To print it, it should be in the form of string. This can be done by using stringi...
read more
C Language
c-puzzle
cpp-macros
C-Macro & Preprocessor
C Preprocessor Directives
Last Updated: 21 May 2025
In C programming, the preprocessor is a program that process the source code before the actual compilation begins. It uses preprocessor directives are commands that instru...
read more
C Language
C++
C Basics
cpp-macros
C-Macro & Preprocessor
Macro & Preprocessor
When to Use Enum Instead of Macro in C++?
Last Updated: 18 March 2024
In C++, both enums and macros are used to define symbolic names for a set of values. However, there are certain situations where using an enum is more beneficial than usin...
read more
C++ Programs
C++
Picked
cpp-macros
CPP Examples
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !