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 is the difference between equal to (==) and assignment operator (=)?
Write a program using display() function which takes two arguments.
Is turbo c++ free?
What is operator overloading in c++ example?
What is a constant reference?
What do you mean by function overriding & function overloading in c++?
What is the difference between ++ count and count ++?
What is null pointer and void pointer?
What is low level language in simple words?
What is null c++?
What is an associative container in c++?
How many types of comments are there in c++?
Is facebook written in c++?
Is it possible for a member function to use delete this?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?