Tutorials - C++ Programming Quiz on Inline Functions

Quiz: Inline Functions in C++

1. What does the inline keyword do?
A. Indicates a function declaration
B. Tells the compiler to use the function only within the same
source code file
C. Causes all function calls to be replaced by the code
from the function
D. Allows one-line function declarations

2. Why would you want to use inline functions?
A. To decrease the size of the resulting program
B. To increase the speed of the resulting program
C. To simplify the source code file
D. To remove unnecessary functions

3. Which of the following is a limit on inline functions?
A. Inline functions cannot return a value.
B. Inline functions must resturn a value.
C. Inline functions must be less than ten lines.
D. The compiler may choose to ignore an inline directive.