Q:

What to do when original question source code is edited in impropper way and your answer is being down voted

Sometimes when answering questions you might found one with source code and at the moment of your reading you post an answer that stop making sense because the user edited it very quickly and change the code to add "better clarification". The question is clarified but the meaning of the original code change completely.
The SO rules states that you should not change source code in a way that completely change the original question. When should I make edits to code?
Because of the change you start to receive down votes so my question is should I edit my answer to stop receiving down votes or flag the question for breaking Stack Overflow rules?

A:

If the fundamental question hasn't changed, then a change of code snippets, especially for better clarification, is perfectly acceptable. However, if the question is completely changed from the original intent, then the question should be rolled back.
If your answer becomes invalidated by a change of code in the original question, you can edit your answer to take into consideration the code changes in the question or you can delete your answer.
The question always comes before the answers in the hierarchy of things, so you shouldn't think about editing the question to fit your answer.

