>// unecessary brackets
Which can be used to introduce a new scope without adding a one-off function or doing something dumb like:
You'd see it more in C prior to C99 where you want to restrict the scope of a for loop control variable:
/* i isn't visible here */
{
int i;
for ( i = 0; i < N; i++ ) {
/* Do stuff */
}
}
/* nor is i visible here. yay */
>// oops no return 0
That's perfectly legal in C++. If you omit the return value from main, 0 will be returned automagically.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004