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
List the issue that the auto_ptr object handles?
Explain the difference between c & c++?
What is meant by the term name mangling in c++?
Discuss the possibilities related to the termination of a program before entering the mainq method?
What is pointer -to-members in C++? Give their syntax?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
What is a class definition?
What is the difference between set and map in c++?
Array base access faster or pointer base access is faster?
What is DlgProc?
Explain the problem with overriding functions
Why should you learn c++?
What does scope resolution operator do?
What are the stages in the development cycle?
What are proxy objects in c++?