CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Inline functions:

a function is stored only once in the computer memory. No matter how many function calls you have in your program. This saves computer memory.

  • computer has to spend extra time and memory to switch to the function and back to the program.
  • It may not be convenient to write functions for very simple tasks!

Inline functions (only exist in C++) are repeated everytime you issue a function call.

 

  • spend memory by repeating code;
  • saves time and instructions to switch back and forth;
How do we?

precede the header with the keyword: inline

illustration