There were two questions with similar looking titles:
return statement vs exit() in main()
What is the difference between exit and return?
Both questions have similar titles, but really one was about expert knowledge of the difference between exit()
and return
in a very specific case (only in the main
function and for C++). The other question was a beginner's one about the difference between exit()
and return
anywhere in a program, but only for C code.
C++ and C are different languages and there are very specific issues about early exit of functions (the object destructors are not called). There are also issues specific to the main function (VMS returns different value if you exit a process using return from main
or exit()
).
For months the two questions were marked as duplicates, which was obviously wrong for people understanding C or C++ and for anybody reading the answers. Finally the erroneous duplicate mark was removed yesterday and the two questions went back to their normal state.
Surprise: a few hours ago a moderator, Flexo, took it upon himself to merge both questions! Even worse than the previous duplicate mark that had finally been removed.
Now what should be done? Basically, who watches the watchmen?
As my answer became meaningless after merging, should I delete it? Or change the question to make it broad enough to justify both kind of responses and add content to my answer to explain both C++ and C behaviors?
I also considered raising the issue to the involved moderator, but I have found no way to contact a specific moderator (maybe a comment to @Flexo).