[C] Expanding a function inline?

From: Elliot Marks (emarks_at_email.net)
Date: 11/30/03


Date: Sun, 30 Nov 2003 15:01:46 GMT

Can someone explain exactly what happens when a function is expanded
inline instead of being called?

#include <stdio.h>
inline void func(void);

int main(void)
{
   func();
   return 0;
}

inline void func(void)
{
   puts("hello, world");
}

How can the code within the function be executed without being called?
Under what circumstances is it advantageous to expand a function inline?



Relevant Pages