相关疑难解决方法(0)

递归函数可以内联吗?

inline int factorial(int n)
{
    if(!n) return 1;
    else return n*factorial(n-1);
}
Run Code Online (Sandbox Code Playgroud)

在我阅读本文时,发现如果编译器没有正确处理上述代码会导致"无限编译".

编译器如何决定是否内联函数?

c c++ compiler-construction

132
推荐指数
4
解决办法
4万
查看次数

标签 统计

c ×1

c++ ×1

compiler-construction ×1