In what scope is a struct member identifier put?

前端 未结 4 1761
南方客
南方客 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:24

    Scope and name space are two entirely different concepts and should not be confused.

    An instance of a struct or union has scope, but the individual member names do not; the concept of scope simply doesn't apply to them.

    Argh, I was thinking in terms of extent, not scope.

提交回复
热议问题