主要的4个陈述之间是否有任何差异?我觉得只有apply2(&func)才有意义.但是,所有4都返回相同的值.
int func(void)
{
return 1;
}
int apply1( int f1(void) )
{
return f1();
}
int apply2( int (*f1) (void) )
{
return f1();
}
int main()
{
apply1(func);
apply1(&func);
apply2(func);
apply2(&func);
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我最近在C11中进行了探索,许多新功能使我更容易使用C代码.我想知道C++ 11正式支持所有这些功能.我关心的不是实现或编译器问题,而是新的C++标准.