Can you please explain the difference between using macro and inline functions?
Answer / Nivedita Valecha
Macros are textual replacements that are expanded during preprocessing, while inline functions are expanded during compilation. Macros do not have a function call overhead, but they can lead to unintended behavior due to side effects and lack of type safety. Inline functions provide the performance benefits of macros with the added advantage of type safety and avoiding issues like operator precedence.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the use of main function in c++?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is a breakpoint?
Explain the uses oof nested class?
Can class objects be passed as function arguments?
What do you know about near, far and huge pointer?
What is the difference between public, private, protected inheritance?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What are structs in c++?
Explain rtti.
Explain the difference between c++ and java.
What is an associative container in c++?