Possible Duplicate:
Benefits of inline functions in C++?
What is the difference between
#include <iostream>
using namespace std;
int exforsys(int);
void main( )
{
int x;
cout << "n Enter the Input Value: ";
cin>>x;
cout << "n The Output is: " << exforsys(x);
}
int exforsys(int x1)
{
return 5*x1;
}
and
#include <iostream>
using namespace std;
int exforsys(int);
void main( )
{
int x;
cout << "n Enter the Input Value: ";
cin>>x;
cout << "n The Output is: " << exforsys(x);
}
inline int exforsys(int x1)
{
return 5*x1;
}
these two definition is work same for a code I guess, then what's the advantage of using the inline function definition?