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
Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

develop a program read the following information from the keyboard in which base class consist of employee name code and destingnation the derived class contain the data members th

C Program for CREATE MATRICES #include stdio.h> #include conio.h> void main() {           int a[10][10],rw=0,clm=0,i=0,j=0;           char s=' ';           c



fine the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder''s name (string), account nu

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.     #include float start

A: In C++ there is a main difference among a template and a macro. Merely a macro is a string which the compiler replaces along with the value that was defined. For example #define

Ask4. Write a query to display the columns listed below. The query should list each customer in which the video rental is overdue. The Days_Overdue column should calculate the numb

what happens when the following command is used? chmod u=rwx,go=r-x foo