Inline function:
It is the function that is expanded inline when it is called with corresponding code. The syntax for making inline is inline return-type function-name(no arguments/arguments)
Note:- inline function should always have return type.
Advantage:
- It reduces the exception time of a program with function having fewer lines of codes.
Disadvantage:
- The execution time of inline function is more than normal function if the function has the larger number of codes or more lines of code.
- It does not work for the recursive course.
No comments:
Post a Comment