Which statement is true regarding the difference between inline functions and macros in C?

  • Inline functions can have local variables
  • Inline functions cannot be used with conditional compilation
  • Macros are preprocessed
  • Macros are type-safe
Macros in C are preprocessed, meaning they are replaced by their definitions before compilation. This can lead to unexpected behavior and debugging challenges. In contrast, inline functions are compiled as proper functions with type safety and can have local variables.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *