inline内联函数

/*实验内联函数的作用
*1.实现c中宏的作用
×2.多个cpp文件一个h文件关于一个函数的定义
*/
#include<iostream>
using namespace std;

int inline g(int x=10)
{
	return x+x;
}

int test(int y)
{
	return g(y);

}

int main(void)
{

	cout<<__func__<<test(2)<<endl;;
	return 0;
}

posted @ 2015-11-05 19:45  cloudren2020  阅读(78)  评论(0编辑  收藏  举报