Advantages of inline functions - C++

Advantages of inline functions.

A function when defined as INLINE, the code from the function definition is directly copied into the code of the calling function. A function is defined as inline using the 'inline' keyword as shown below :
inline float add(float i, float j) { return i + j};
Advantages : - It avoids the overhead of calling the actual function. This is because the complier performs and inline expansion which eliminates the time overhead when a function is called.
- It reduces space as no separate set of instructions in memory is written.

Advantages of inline functions.

- It relieves the burden involved in calling a function.
- It is used for functions that need fast execution.
Different access specifiers for the class member in C++
Different access specifiers for the class member in C++ - private: It is default one and can be access from class member of the same class...
What is the importance of mutable keyword? - C++
What is the importance of mutable keyword? - The mutable keyword allows the data member of a class to change...
Pointer vs. reference - C++
Pointer vs. reference - A reference must be initialized at the time of declaration whereas not needed...
Post your comment
Discussion Board
this pointer
any professor explain this pointer,new();delete(),and please any updating in the session mansion in the examples is very must
priya 03-2-2013
good
this job is very useful and more than peoples like this ...............................................................................................................................................
priya 03-2-2013