Inline Function MCQs – C++

1. What is syntax of inline function?

(A). return-type

inline function-name(parameters)

{// Your code}

(B). return-type

function-name(parameters) inline {// Your code}

(c). inline return-type

function-name(parameters)

{// Your code}

(D). None of these

inline means that compiler can replace those function definitions on the place where function called

2. Request for making a function inline can be___?

(A). Accepted by the compiler

(B). Rejected by the compiler

(c). Can be accepted or rejected depends on function size

(D). None of these

3. Making a function inline means that compiler can replace those function definitions on the place________?

(A). where they are defined

(B). where they are called

(B). Both a and b

(D). None of these

4. What is the effect of the Inline function on executable size?

(A). No effect on executable size

(B). decreases the executable size

(c). increases the executable size

(D). None of these

5. The time at which the executable code is started running is called?

(A). Critical time

(B). Compile time

(c). run time

(D). None of these

Compile-time: The time required for a source code to convert into an executable code is called Compile time.

Run time: The time at which the executable code is started running is called run time.

6. What is the effect of the Inline function on memory?

(A). Can cause thrashing

(B). Can cause more number of page faults

(c). Both a and b

(D). None of these

 

7. When the inline function is resolved/expanded?

(A). compile time

(B). run time

(c). Before run time

(D). None of these

8. What is the effect of Inline Function on the locality of reference by utilizing instruction cache?

(A). No effect

(B). decreases

(c). increases

(D). None of these

 

9. What is the effect of using small inline functions on the number of cache misses?

(A). increase the number of cache misses

(B). decrease the number of cache misses

(c). No cache misses

(D). None of these

10. What is the effect of using large inline functions on the number of cache misses?

(A). increase the number of cache misses

(B). decrease the number of cache misses

(c). No cache misses

(D). None of these

11. If a function is big, then the compiler can _____to make the function inline?

(A). Ignore the request

(B). Accept request

(c). Both A and B

(D). None of these

12. When compiler ignore making a function request to make a function inline?

(A). Complex operations or function has static variables.

(B). the Large number of lines in code

(c). If the function is recursive

(D). All of these

Inline Function in C++ – Tutorial

Programming C Plus Plus MCQs Homepage

shamil memory table