Is it possible to declare multiple static variables with same name in a single C file?

前端 未结 6 1636
眼角桃花
眼角桃花 2020-12-03 08:34

Is it possible to declare multiple static variables of same name in a single C file with different scopes? I wrote a simple programme to check this and in gcc it got compile

6条回答
  •  忘掉有多难
    2020-12-03 09:28

    Both function will create different stacks, so static part also will be different .Therefore it is possible.

提交回复
热议问题