O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Inline Functions

New to C99 is the ability to create inline functions: user-defined functions that will, theoretically, perform faster. Inline functions are normally defined before the main function and are preceded with the keyword inline. For example:

#include <stdio.h>
inline int my_func() {
   // Function content.
}
int main (void) {...

Inline functions do not require the prototype, because they are defined before the main function.

These types of function definitions have the potential to be faster because the compiler treats them differently. Instead of setting aside the resources necessary for defining a new function, the compiler will go through an application's code, replacing calls to the inline function with the function code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required