Difference between inline functions and macros - C++

What is the difference between inline functions and macros?

- A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro. There are two kinds of macros: Object-like macros and function-like macros.
- Inline function is a function that is expanded in line when the function is called. That is the compiler replaces the function call with the function code (similar to macros).
- The disadvantage of using macros is that the usual error checking does not occur during compilation.
What are static member functions?
What are static member functions? - A static function can have an access to only other static members (functions or variables) declared in the same class......
Do inline functions improve performance? - C++
Do inline functions improve performance? - Inline functions behave like macros. When an inline function gets called, instead of transferring the control.....
What happens when recursion functions are declared inline? - C++
What happens when recursion functions are declared inline? - The call to the body of the function is replaced by an inline function. This reduces the saving context on stack....
Post your comment