1.

Inline functions are avoided when ____________________________(a) function contains static variables(b) function have recursive calls(c) function have loops(d) all of the mentionedThis question was addressed to me during an interview for a job.My question is based upon Classes in division Source Files, Classes and Operator Overloading in C++ of C++

Answer»

The CORRECT answer is (d) all of the mentioned

The explanation is: Inline functions are avoided in all the above cases as whole inline CODE is COPIED to the point of call so compiler avoids to make large functions as inline. Even if you yourself MENTION inline but the FUNCTION is large compiler ignores your request of inline and treats that function as a normal function.



Discussion

No Comment Found

Related InterviewSolutions