Why are declarations put between func() and {}?

前端 未结 3 1805
执念已碎
执念已碎 2020-12-07 04:16

In sed source I saw often

func(...)
int b;
char c;

{
...
}

Why put variables there? Does it change the scope?

Like here: http://ww

3条回答
  •  独厮守ぢ
    2020-12-07 05:07

    That's just old style, pre-ANSI C. The whole notion of function declarations with type parameters wasn't introduced until later!

提交回复
热议问题