Any idea on which rule in standard states the statements like this:
p++; //where \'p\' is pointer to array
cannot appear in global scope? <
CHeck out "The C++ programming Language" by of course Stroustrup.
Section r.6.1 talks about statements - which can be labels, expressions, compound statements, selection statements, iteration statements, jump statements or declaration statements.
Then jump back to section 3.3.1 Which shows the statement syntax and references: Note that.....there is no assignment statement or procedure call statement. Assignment and function call are handled as expressions.
Section r.3.1 then talks about four types of scope - local, function, file and class. Since global is essentially "file" scope. Names are allowed in global scope as are classes first declared in a return or argument type.
Really could find no concrete definitive that flat out states you can't have an expression statement in global scope, but by omission the references show what you CAN have.