is it possible in C or C++ to create a function inside another?

后端 未结 15 1927
迷失自我
迷失自我 2020-12-15 09:18

Could someone please tell me if this is possible in C or C++?

void fun_a();
//int fun_b();
...
main(){
   ...
   fun_a();
   ...
   int fun_b(){
     ...
            


        
15条回答
  •  有刺的猬
    2020-12-15 09:27

    Clang/Apple are working on 'blocks', anonymous functions in C! :-D

    ^ ( void ) { printf("hello world\n"); }

    info here and spec here, and ars technica has a bit on it

提交回复
热议问题