Multiple choice technology programming languages

Which of the following is(are) true for Macro functions(#define fn()) & inline functions

  1. macro functions are expanded during compile. Inline functions are just usual functions calls

  2. macro functions are expanded during preprocessing and inline functions are expanded during compile

  3. macro functions are expanded during compile and inline functions are expanded during preprocessing

  4. No difference.Both are expanded at compile.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Macro functions (created with #define) are expanded by the preprocessor before compilation begins, resulting in text substitution. Inline functions are expanded by the compiler during compilation, with the inline keyword being a hint (not a guarantee) for function call replacement. Option A is wrong because it misstates when inline expansion occurs. Option C reverses the correct phases.