At the risk of repeating several points I've previously made on Meta yet again:
which I think was overkill as they were maybe not the highest quality but still quite understandable and answerable.
This is not even close to sufficient.
The purpose of the site, as described in the tour, is to build a library of high-quality answers. This requires high quality questions that prompt answers that belong in a library. To be useful as part of a library, these questions need to:
Not be closable, as described in Question Close Reasons - Definitions and Guidance. Every question that should be closed also merits downvoting. If it's being closed as "needs details or clarity" then it's also almost certainly "unclear"; if it "needs more focus" or "needs more debugging details" then it very likely also "does not show research effort"; and in any event it is certainly "not useful" - since voting to close means signalling that the question should not be answered, and a question can only contribute to a Q&A library insofar as it prompts answers.
describe problems that other people can have - not just serve as requests or support tickets to fix a problem the OP is experiencing. What good is a library that is full of books that are only of interest to their authors? In particular, "questions" that boil down to expecting someone else to find the bug in some code sample are not suitable for Stack Overflow - and they will normally be closable as either "needs more focus" or "needs debugging details". It is the OP's responsibility before posting to isolate the bug first and create a minimal reproducible example, and I have a copy-paste feedback comment template in my profile for this case (because it is so common).
The fact that such a large fraction of Stack Overflow users want to use the site software a certain way, does not justify them in doing so. The site is designed with a specific purpose in mind; that purpose potentially allows for the creation of something truly valuable; the actions of such users directly go against that purpose and diminish the value of the site; and there are countless existing other places where people who want to "help" each other in that way may do so. (For example, Python users can try https://reddit.com/r/learnpython, https://reddit.com/r/python or https://discuss.python.org/.)
In the specific cases you describe:
For the first question, even after editing to include properly formatted code, it is not a MRE. Most of the error message is in a foreign language, which is unhelpful; there are dozens of lines of code for a common sort of error; there are multiple lines of noise in a question that seems to boil down to just "what is wrong here?" but without a clearly identified "here".
While most of this could be fixed by other editors, even given a MRE, the underlying Q&A ("Q. Why can't I use std::exception
? A. You need to #include <exception>
first") is a common problem that demands a proper beginner-oriented canonical - assuming that the existing general one is considered insufficient.
Aside from all of that, your answer demonstrates that there are many other things wrong with the code besides the issue that actually prompted the question. The purpose of Stack Overflow is not to fix code posted by the OP and solve the problem for one user. The purpose is to build the searchable library so that everyone can get answers. Pointing out other problems in the code is not answering the question. The existence of those problems in the code in the question is distracting from the actual question. The question needs to be about one thing.
The second tried to use an image of code; other users should not attempt to transcribe these (although once you've put in the effort, it's better off left that way; the rollback war there was silly IMO). But the image wasn't even inlined (as this is blocked for new users), and the question text blatantly misused formatting (initially setting most of the question text in <h1>
header text; the edit to include an image only accidentally avoided this).
Aside from that, the question is not clear. Does OP has a specific function in mind? Which one? Or is the question instead asking whether there is, indeed, such a function built in? Or is it asking about how to implement one? It also isn't clear why using sizeof
in the normal way doesn't meet OP's needs. The grammar used in the question is a complete mess, and your edit doesn't attempt to fix this - so, quite frankly, I don't even agree with you assessment of the question as "quite understandable".
I hope that is not the case.
I hope it is.
Answering bad questions makes it harder to keep the site clean. Even when there is a potentially good "underlying" question and someone properly answers it (and nothing else), that question is usually a duplicate of something somewhere else. Standard debugging techniques normally lead to isolating a commonly-encountered issue with a standard explanation. Writing an answer in these cases is at best putting the answer in the wrong place; most commonly it is duplicating effort (and many of the most popular dupe targets already have way too many answers).
A lot of this answering is done by people who write tons of answers, almost all of them to bad questions, apparently in search of a quick upvote and/or accept vote from the OP for up to 25 reputation at a time. (What a shame that I can only offset 2 of that when I see a familiar username attached to yet another such answer.)
I have certain old answers from 2010 or so with hundreds of upvotes that I would gladly delete if I didn't fear further repercussions for deleting such supposedly "valuable" content. The last privilege is awarded at a mere 25k reputation and I have more than double that. But some users seem to value these points in and of themselves, and have an insatiable appetite for them. (Or perhaps they take the "leaderboard" seriously.) That is not a recipe for quality.