草庐IT

c++ - "error: ’ myfn' declared as function returning a function"是什么意思?

我正在尝试编写一个返回函数指针的函数。这是我的最小示例:void(*myfn)(int)()//Doesn'twork:supposedtobeafunctioncalledmyfn{//thatreturnsapointertoafunctionreturningvoid}//andtakinganintargument.当我用g++myfn.cpp编译它时,它打印出这个错误:myfn.cpp:1:19:error:‘myfn’declaredasfunctionreturningafunctionmyfn.cpp:1:19:warning:extendedinitializerli