There was a proposal recently in comp.lang.c++.moderated to treat
all VC++ v6 related queries as off-topic.
I pretty much disagree with the current moderation trends in
comp.lang.c++.moderated---to the point of abandoning the group
completely (although I was one of the founders). But I don't
think they've gotten to the point of censuring because of the
version of the compiler you use.
If someone is trying to implement something using some of the
latest template techniques, of course, I would certainly
recommend that they upgrade the compiler. But not all
organizations insist on obfuscating their code to that degree,
and not all organizations can afford the upgrade. (You might be
able to upgrade without paying a penny to Microsoft, but it
still isn't free. No more than upgrading g++ or any other
compiler is free.)
The reason was that VC++ v6 is so non-standard, that you can't
infer anything from the fact that some code "works" when
produced by VC++ v6.
Nor with any other compiler, for that matter. I suppose you've
heard of undefined behavior.
Not that you would use a single compiler to see whether some
construct is legal, but v6 of VC++ is just awful.
Not awful: old. It's not the same thing. (VC++ 6.0 was one of
the better compilers around when it first appeared. G++ didn't
catch up until five or six years later.)
If you want to check legality using a compiler, of course, about
the only one which is any use at all for that would be Comeau.
Checking with several compilers can also be useful.
Now, your program is ill-formed because you changed the
declaration of the 'main' function.
I just checked the standard, and *IT* says that the code is
legal. FWIW: Sun CC 5.8 and g++ 4.1.0 agree as well, as does
VC++ 8. I'll admit that I didn't expect that, but of course,
::main is treated specially---Sun CC and g++, at least, always
treat it as if it were `extern "C"' (and I didn't check the
generated code this time, but in the past, more than one
compiler I've used generated a lot of extra code in the
function).