A macro is a fragment of code and is the preprocessor directive stated at the beginning of the program before the hash sign. It is the rule or pattern that determines how input sequences should be worked out according to the defined procedure. An inline function in the c ++ and c programming languages is one qualified with keyword inline. It is a particular concept that is typically used with classes.
The chief difference between macro and inline function is that macro is checked by the preprocessor, while the compiler examines an inline role. In the program, the preprocessor directives are put into the source program before the main program. One type of preprocessor directive is macro. The function can be converted to an inline function if the purpose is not very complicated. In macro, the argument is evaluated each time, and with inline, it is only assessed one time.