Search This Blog

Wednesday, December 26, 2012

Inline Functions in C++

Example Inline Function

#include 

using namespace std;

inline void hello()
{ 
  cout<<"hello";
}
int main()
{
  hello(); //Call it like a normal function...
  cin.get();
}
However, once the program is compiled, the call to hello(); will be replaced by the code making up the function.

No comments:

Post a Comment

Thank you