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

What is the size of a vector?

1193


What is the difference between object-oriented programming and procedural programming?

1302


Which ide is best for c++?

1089


What is the use of data hiding?

1066


Where is atoi defined?

1205


Why is it called c++?

1086


Explain bubble sorting.

1142


What are associate containers?

1096


Where Malloc(), Calloc(), and realloc() does get memory?

1102


In what situations do you have to use initialization list rather than assignment in constructors?

1105


How compile and run c++ program in turbo c++?

1237


What is the purpose of ios::basefield in the following statement?

1303


What are references in c++? What is a local reference?

1107


What are manipulators in c++ with example?

1113


Explain storage qualifiers in c++.

1132