What is the difference between function call and macro calls?

1 Answers

Ray Dart Profile
Ray Dart answered

Functions are segments of code that can be called repeatedly from different parts of a program to execute some action. Usually only one function for a given task will exist. Where a macro exists, the actual code will be inserted in the program (at compile time) every time the macro is used.

So function calls result in more compact routines, but there is an overhead as it is called and used. There is no overhead with a macro, but the routine will be larger and occupy more memory.

Answer Question