Why statements cannot appear at namespace scope?

前端 未结 3 1128
逝去的感伤
逝去的感伤 2020-11-28 15:54

Any idea on which rule in standard states the statements like this:

p++; //where \'p\' is pointer to array

cannot appear in global scope? <

3条回答
  •  难免孤独
    2020-11-28 16:16

    By saying "statements like this" I guess you know that/why statements in general cannot be in global scope.

    p++;
    

    Is a statement because it basically is translated into:

    p = p + 1;
    

    Which is a normal statement.

提交回复
热议问题