Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are inline functions?

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


Please Help Members By Posting Answers For Below Questions

How many different levels of pointers are there?

1150


How many keywords are used in c++?

961


What are static member functions?

1045


What are 2 ways of exporting a function from a dll?

1115


What is expression parser in c++

2414


Write a recursive program to calculate factorial in c++.

1025


Explain the isa and hasa class relationships. How would you implement each?

1064


What is a string example?

1014


What is the difference between cin.read() and cin.getline()?

1015


Write a struct time where integer m, h, s are its members?

915


What is the difference between ++ count and count ++?

1084


When there is a global variable and local variable with the same name, how will you access the global variable?

1045


What is the latest version on c++?

1091


What is data hiding c++?

997


How do I run c++?

997