In what scope is a struct member identifier put?

前端 未结 4 1805
南方客
南方客 2021-01-18 10:25

The C spec says

There are four kinds of scopes: function, file, block, and function prototype.

Now if I do the following outside any

4条回答
  •  孤独总比滥情好
    2021-01-18 11:26

    x is in the scope created by struct A, but A is in global scope. This is what the "spec" calls file-scope but the name is misleading because all files that you include share that scope.

提交回复
热议问题