Answer Posted / roshanpr
Functions that are expanded inline ( that we during there
call) is called inline functions.
Usually when there there is a function call the control is
taken to the function definition where the code is executed
and then the control returns back to main. But in case of
inline function there is no jump in the flow, rather the
function it self is expanded at the place of call.
You can make function inline in two ways.
1) Prefixing keyword "inline" durin the function
declaration.
2) By defining the function inside the class declaration
Ex: shows both the implementation
Class myClass
{
int age;
public:
inline void getAge();
void showAge()
{
cout<<"Age:"<<age;
}
};
void myClass getAge()
{
cout<<"Age:"<<age;
}
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What does obj stand for?
What is enum c++?
Write a program which employs Recursion
Can non graphic characters be used and processed in C++?
What are the vectors in c++?
Can I uninstall microsoft c++ redistributable?
Write a program to find the Fibonacci series recursively.
Comment on c++ standard exceptions?
Which programming language should I learn first?
Why was c++ made?
What are the types of array in c++?
What are activex and ole?
What is an inline function in c++?
What is a sequence in c++?
What are the manipulators in c++?