C++源码: 内联函数实例
// Example for INLINE FUNCTION 内联函数,在内存中、速度快 */
#include <iostream>
using namespace std;
inline int power(int a)
{ return ((a)*(a)*(a)); }
main()
{
cout<<"\n\n You are wellcome! Example for INLINE FUNCTION \n\n";
int x;
cout<<"\007"<<"Please input the vallue of X:"<<flush;
cin>>x;
cout<<"\nX="<<x;
cout<<"\n\n Now,after inline int POWER(x)="<<power(x);
}
赞 (0)