C++ Virtual Functions Question:

Download Job Interview Questions and Answers PDF

Can you please explain the difference between using macro and inline functions?

C++ Virtual Functions Interview Question
C++ Virtual Functions Interview Question

Answer:

A textual substitution is provided by a macro as a constant, where as an inline function is procedure which is called at each time. Although the macros have few advantages over inline functions, the disadvantages are numerous.

Download C++ Virtual Functions Interview Questions And Answers PDF

Previous QuestionNext Question
Explain object slicing in C++?Give example of a pure virtual function in C++?