Are nested functions part of C standard?

前端 未结 2 2105
北恋
北恋 2020-12-07 02:41

Today i came across nested functions which i had never heard of. Is it only part of GNU C?

Here is a wikipedia example of nested function.

float E(fl         


        
相关标签:
2条回答
  • 2020-12-07 03:19

    No, they are not part of the C or C++ standard. They are a GNU extension in the GCC compiler. See the GCC manual for more information. It is actually possible to take the address of a nested function, which is done using a technique called trampolines, but beware of the caveats listed in the manual.

    0 讨论(0)
  • 2020-12-07 03:20

    Nested functions are GCC extension, not a standard C

    0 讨论(0)
提交回复
热议问题