Skip to content

Tag Archives: cpp-macros

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… Read More
A macro is a piece of code in a program that is replaced by the value of the macro. Macro is defined by #define directive.… Read More
99.9% of the C++ programs use macros. Unless you are making a basic file you have to write #include, which is a macro that pastes… Read More
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… Read More
Shortcode is ideal in competitive programming because programs should be written as fast as possible. Because of this, competitive programmers often define shorter names for… Read More
C/C++ Preprocessor directives basics Preprocessor directives: In almost every program we come across in C/C++, we see a few lines at the top of the… Read More
Prerequisite – Macros   What is the output of following program?  CPP #include <iostream> using namespace std;   #define a 10   int main() {     int… Read More
As the name suggests, Preprocessors are programs that process our source code before compilation. There are a number of steps involved between writing a program… Read More
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… Read More
How to print and store a variable name in string variable? We strongly recommend you to minimize your browser and try this yourself first In… Read More
Give a = 12 and b = 36 write a C function/macro that returns 3612 without using arithmetic, strings and predefined functions. We strongly recommend… Read More
#define is a preprocessor directive. Data defined by the #define macro definition are preprocessed, so that your entire code can use it. This can free… Read More
In a C program, all lines that start with # are processed by preprocessor which is a special program invoked by the compiler. by this… Read More
Predict the output of the below program   C++ #include <iostream> using namespace std;   #define square(x) x*x   int main() {   int x;   x… Read More

Start Your Coding Journey Now!