What is inline function, C/C++ Programming

Inline function:

It is a function without prototype. The function is defined above main. The function should  be  declared  above  main  function.                 

Declaring  the  function  as  inline  will  increase  the performance, but it is usually used for small functions.   It reduces the memory requirement. Inline function must have return statement in the function at the same it need not have return type. All other function sub program or must definition and prototype.

inline int f_ref(int x, int  y)

{ return (x+y); // Inline function can return statement without return type.

}

void main( )

{

int a, b;

f_ref(a, b);

}

 

 

Posted Date: 9/20/2012 7:46:53 AM | Location : United States







Related Discussions:- What is inline function, Assignment Help, Ask Question on What is inline function, Get Answer, Expert's Help, What is inline function Discussions

Write discussion on What is inline function
Your posts are moderated
Related Questions
I have a program and I want someone to fix it for me by using basic c language program.

Structures A structure is a derived data type. It is a combination of logically related data items. Unlike arrays, which are a collection of such as data types, structures can

program that counts the number of occurrences of the string in the n-th padovan string p(n)

The zipped folder int_collection.zip (downloaded from Blackboard) contains an abstract class AbstractIntCollection and two interfaces: IntList and IntStack. The abstract class cont

real time application of b tree


Pointers are just numbers, representing addresses in memory. You can add to and subtract from pointers, for instance. It is pretty easy to make mistakes with pointer math, however,

Program is to create a file student.dat: Program is to create a file student.dat which contains all name, roll_no,marks(5 sub) and percentage   class student    {

#question. write a program number to alphabet in c++..

How to specify different memory sections for a variable using #Pragma?