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  Want to learn from the best curated videos and practice problems, check out the C++ Foundation Course for Basic to Advanced C++ and… 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
Macros are pre-processed which means that all the macros would be processed before your program compiles. However, functions are not preprocessed but compiled. See the… 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 firstTake a… 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 #define square(x) x*x int main() {   int x;   x = 36/square(6);   printf("%d",x);       getchar();   return 0; } Output:… Read More