Inline Function used by program then function is expanded inline at Run time - C++ basic concepts

Q.  If a program uses Inline Function, then the function is expanded inline at ___________.
- Published on 17 Jul 15

a. Compile time
b. Run time
c. Both a and b
d. None of these

ANSWER: Run time
 

    Discussion

  • omkar khedkar   -Posted on 27 Oct 19
    • The C++ inline function provides an alternative. • With inline keyword, the compiler replaces the function call statement with the function code itself (process called expansion) and then compiles the entire code. • Thus, with inline functions, the compiler does not have to jump to another location to execute the function, and then jump back as the code of the called function is already available to the calling program.
  • Rahul Chavan   -Posted on 07 Jan 17
    When the inline function is called whole code of the inline function gets inserted or substituted at the point of inline function call. This substitution is performed by the C++ compiler at compile time.
  • shalu sheoran   -Posted on 12 Jun 16
    Sir there are two answer of this question one in the explation and one given below the question sir which is right
  • ramesh   -Posted on 13 Oct 15
    If a program uses Inline Function, then the function is expanded inline at compile time. Inline function is best, when the function size is less.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)