I've just found this c++ question: invalid conversion in C++. It is about a compilation error when using pointers to functions. It may not be self evident why the OP wrote this code, but the question contains:
- the line that causes a compilation error (and enough context around it to understand that the error does not come from a previous line)
- the full declaration of the struct containing the pointer to function
- the exact error message
Despite this, the question soon got 2 down votes and one close vote for not containing an MCVE.
I admit that this usage of pointers is not common in C++ (at least for me) and I really had to read the question 3 times to fully understand it. But it was not because of the way it was written, simply that I had never encountered this kind of error before.
I know that we want to avoid poor questions in Stack Overflow, but this one already contained all that was necessary to understand the problem and the problem was not that trivial.
Maybe it lacks some context that was later added in a comment: that the OP got into this problem because they were porting working C code to C++.
So my question is: how could this question be written to be well received on Stack Overflow, or if it is the kind of question that we do not want, what are the reasons?
BTW: I posted an answer that was immediately accepted, so OP provided feedback on their question.
SHA1_Init
although it is completely clear from the error message what it is. It might get downvoted because the coding style is terrible for modern c++, but I also don't see any reason for closing the question.static_cast
so it is clear he was using C++ (even if the code has a visible C origin)