Difference between macro and function in C++.
Answers
Answered by
1
Here is ur answer :-
The basic difference is that function is compiled and macro is preprocessed. When you use a function call it will be translated into ASM CALL with all these stack operations to pass parameters and return values. When you use a MACRO, C preprocessor will translate all strings using macro and than compile.
I hope it helps u dear ☺️....
The basic difference is that function is compiled and macro is preprocessed. When you use a function call it will be translated into ASM CALL with all these stack operations to pass parameters and return values. When you use a MACRO, C preprocessor will translate all strings using macro and than compile.
I hope it helps u dear ☺️....
Answered by
0
Function is compiled..
Macro is pre-processed..
Macros are usually one liner.
Macros are highly recommended for less allocation of memory space.
The main disadvantage of macro is
no type checking..
Macro is pre-processed..
Macros are usually one liner.
Macros are highly recommended for less allocation of memory space.
The main disadvantage of macro is
no type checking..
Similar questions