Tag Archives: Macro

How to write multiline macro in C language?

Quick links

How to write multiline macro in C programming language. We generally define macros that spans over single line. However there exists situations when you want to define a macro that spans over multiple line.

In this post I will explain how to write a multiline macro in C language. So let us get started.

Continue reading How to write multiline macro in C language?

C program to find square and cube of a number using macro – #define SQUARE(x), #define CUBE(x)

Write a C program to find square and cube of a number using macro. How to find cube of a number using macro #define preprocessor directive in C program. Logic to find square and cube of a number using macro.

Continue reading C program to find square and cube of a number using macro – #define SQUARE(x), #define CUBE(x)

C program to define, undefine and redefine a macro – #define, #undef

Write a C program to define, undefine and redefine a macro (compile time constant). How to define, remove and redefine a macro in C programming. How to define, remove and redefine a compile time constant (macro) in C programming.

Continue reading C program to define, undefine and redefine a macro – #define, #undef