1.

What Are Inline Functions? What Are Their Advantages? How Are They Declared?

Answer»

An inline function is a function which gets textually INSERTED by the compiler, much like macros. The advantage is that execution time is shortened because linker OVERHEAD is minimized. They are declared by USING the inline keyword when the function is declared: 

inline void FUNC(void) { cout &LT;< "printing inline function n"; } 

or by including the function declaration and code body within a class: 

class test 

tv public: 

void func(void) { cout << "inline function within a class.n"} 

};

An inline function is a function which gets textually inserted by the compiler, much like macros. The advantage is that execution time is shortened because linker overhead is minimized. They are declared by using the inline keyword when the function is declared: 

inline void func(void) { cout << "printing inline function n"; } 

or by including the function declaration and code body within a class: 

class test 

tv public: 

void func(void) { cout << "inline function within a class.n"} 

};



Discussion

No Comment Found