Explain the difference between using macro and inline functions?



Explain the difference between using macro and inline functions?..

Answer / Ravi Kumar Ravi

Inline functions are functions that are expanded in-line at the point of call during compilation, resulting in faster execution. Macros, on the other hand, are textual substitution mechanisms that replace a sequence of characters with another set of characters, which can lead to unintended consequences and are generally discouraged for complex operations.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Declare a class vehicle and make it an abstract data type.

1 Answers  


What does ios :: app do in c++?

1 Answers  


What are disadvantages of pointers?

1 Answers  


Which is the best c++ software?

1 Answers  


Who invented turbo c++?

1 Answers  


Why do you use the namespace feature?

1 Answers  


How do you show the declaration of a virtual constructor?

1 Answers  


What is the difference between C and CPP?

1 Answers   iNautix,


What is endl?

1 Answers  


What is null pointer and void pointer?

1 Answers  


What is virtual destructors? Why they are used?

1 Answers  


What are keywords in c++?

1 Answers  


Categories