Pages

Friday 18 March 2011

PROGRAM OF INLINE FUNCTION

DESCRIPTION-:INLINE function is one which increase the performance of function in very large programs.Actually it replaces the function definition with the function call and with this the program control does not transfer to the function definition at each time when the function call is execute  thus increases the performance.


PROGRAM-:
#include<iostream.h>
#include<conio.h>
inline int max(int x,int y)
{
return(x>y?x:y);
}
void main()
{
clrscr();
int a,b,c;
cout<<"enter two numbers";
cin>>a>>b;
c=max(a,b);
cout<<"greatest of two number is"<<c;
getch();
}

0 comments:

Post a Comment

 
Copyright (c) 2010 Concepts Of C++. Design by WPThemes Expert

Blogger Templates and RegistryBooster.