What is inline function?
Explain with an example.
Latest answer: An inline
function is a combination of macro & function. At the time of
declaration or definition, function name is preceded by word
inline................
Read answer
What is the difference
between inline functions and macros?
Latest answer: A macro is a
fragment of code which has been given a name. Whenever the name is
used, it is replaced by the contents of the macro. There are two
kinds of macros: Object-like macros and function-like
macros.................
Read answer
What are static
member functions?
Latest answer: Static member
functions are used to maintain a single copy of a class member
function across various objects of the class. Static member
functions can be called either by itself, independent of any object,
by using class name and :: (scope resolution operator) or in
connection with an object.................
Read answer
Do inline
functions improve performance. Explain.
Latest answer: Inline
functions behave like macros. When an inline function gets called,
instead of transferring the control to the function................
Read answer
What happens
when recursion functions are declared inline?
Latest answer: The call to
the body of the function is replaced by an inline function. This
reduces the saving context on stack overhead. This process is
efficient when the size of the function is small and
invoked................
Read
answer
Advantages and
disadvantages of using macro and inline functions.
Latest 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...................
Read answer