C Programming Reference >> C Basic Tutorials >> C Keywords Home >> inlineui 30/12/06 - Views - Ratings : This keyword is taken from C++ . Its applicable to functions. This keyword tells compiler that the function has to be expanded inline. This means that where ever in the program there is a function call to this function the function code has to be pasted there. This makes the execution of program faster at expense of storage space as size of the code increases. Inline function is only a request to the compiler and various compilers decide in their own way wether the function deserve to be inline or is thier an efficiency gain by making function inline only then the function is made inline. Generaly a function which is small in size and called several times by your program should be made inline. Code - inline void function (void)
{
int a = 10;
int b;
scanf ("%d", &b);
a = b;
printf ("a is now %d", a);
}
|