![macro programming language list macro programming language list](https://www.excel-vba.com/zi-vbe-code-step-first.jpg)
In C, the macro is used to define any constant value or any variable with its value in the entire program that will be replaced by this macro name, where macro contains the set of code that will be called when the macro name is used in the program. In C programming language, the macro is not less than similar to functions, but macro has built-in macro also. In the above code, we are defining function-like macro where an argument “n” is passed with “#n” which will allow you to retrieve string literal.
![macro programming language list macro programming language list](https://www.cnccookbook.com/wp-content/uploads/2017/10/img_59f204cd56d60.png)
The macro can also be written in multiple lines starting the statements with “\” and no need to end with “\”.Printf("\n This uses int datatype %d", INCREMENT(a)) Printf(" This use char datatype %s ", INCREMENT(p)) You should note that when the argument passed to the function-like macro where it supports any datatype.For example, we saw in the above code “#include” in this “stdio.h” is a header file we use this header file because to read and print the values we use “printf” and “scanf” are within this “stdio.h” header file.
![macro programming language list macro programming language list](https://www.automateexcel.com/excel/wp-content/uploads/2018/09/automacro-vba-code-generator-main.png)
Similarly “#include” is used to include the header files in the C program. In C language, when we use “define” for defining a macro with “#” prefixed is used for defining constants for the entire program, so when we define a constant with some macro name then in the entire program the defined constant is matched and is replaced with the value that is assigned at the starting of declaring the macro with “#define” statement.Before using macro in C programming we should note the following points: