Is there a use for function declarations inside functions?

前端 未结 4 1264
时光取名叫无心
时光取名叫无心 2020-12-01 21:06

We can declare functions inside functions (I wanted a local variable, but it parses as a function declaration):

struct bvalue;
struct bdict {
    bd         


        
4条回答
  •  渐次进展
    2020-12-01 21:43

    Are the sole reasons "because it makes the parser simpler" and "because the standard says so"

    Yea, basically.

    Everything that can be a function declaration, is a function declaration.

    Unfortunately it's one of those "just is" cases.

提交回复
热议问题