I have posted a question, and then later I found the mistake and solution by myself. Can I give this as the answer to my own question? If I give that answer, what will happen?
You can, but should consider several things first:
- If somebody else found the mistake and tried to solve it, you better let him Edit his answer with the correct fix then Accept it.
- If there are answers already but none is relevant then by all means, add your own answer with what you did to fix the problem and Accept it.
- If there are no answers and the question is "local", meaning not something generic that can be useful for others, then just Delete your question after putting comment you found the mistake, so that it won't get undeleted.
Looks like the question in question falls into the 3rd category - you can click the "delete" link and as it has no answers, there will be no harm done.
Yes you can, just click the mark that says this is the correct answer
Yes you can. You can also accept it.
Depending on your reputation, you might have to wait a bit before you can do either of those, but it's perfectly acceptable, and welcome.
You can accept your own answer, and if it is the correct solution this is even wanted: other can easily see the solution to the question at a glance (especially important if there are already wrong/incomplete answers that might even have a higher vote than your answer and thus will be shown before your answer; lots of readers would miss your answer if you didn't mark it as such).
It is possible to answer your own question and accept it as your solution.It is actually a great thing to answer your own question, when your question didn't get enough views or answers or you couldn't get a solution from SO, because that question will have a solution below it and other people will benefit from it.You have to wait for some time to accept your answer to your own question like 2 or 3 hours or days, you will see it when you click the tick.
I have done it a couple times.