Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

So, I was answering some questions in SO earlier, and I came across this post:

C++ - called object 'char *' type is not a function or function pointer

And I was the third to answer, and my answer was the only one which had working code (at the time I posted) to explain to the OP what the problem was.

The issue was, that one person who came along, glglgl, came along, and down voted my post, as he didn't like the extern keyword. Thus, another user the up votes, while I got none, whilst I had actually put some effort into explaining a solution to the OP.

What am I expected to do in this situation? My answer was correct, and was in line with the solution in C, as the question was tagged, as well as I added a more C++-esque answer.

Where did I go wrong here? What can I do in the future for preventing this from happening to me again?

share|improve this question
Post on meta so that your good answer gets noticed? ;-) – Jon Ericson Jun 20 '12 at 13:01
@JonEricson that wasn't the purpose of this post. I want to know what I can do to prevent this from happening in the first place. Was there something specific I did to make glglgl angry? Or was he just tactical down voting? – Richard J. Ross III Jun 20 '12 at 13:03
It looks to me (after reading the question) that glglgl thought the original version of the answer was wrong. I don't see any anger or malice. Responding to the criticism by editing the answer was a good move. Misunderstandings like this are unavoidable at times. – Jon Ericson Jun 20 '12 at 13:10
I would imagine you've received downvotes for supplying a more involved, less idiomatic, and potentially problematic solution to a simple problem of shadowing... – user7116 Jun 20 '12 at 15:50
up vote 8 down vote accepted

What am I expected to do in this situation?

Answer some more questions and move on. If your answer is truly correct, then the downvote will be corrected by the rest of the community at some point in the future.

Where did I go wrong here?

Nowhere, I don't think. I'm not a C/C++ guru so I can't speak to your answer, but you've contributed to the community and someone happened to disagree. That's going to happen occasionally.

What can I do in the future for preventing this from happening to me again?

Nothing, IMO. Answer questions to the best of your ability with the knowledge that downvotes are part of the community. Pay attention to those who explain their downvotes as they may be correct and actually be helping original poster of the question and steering them away from misleading or incorrect answers (not saying that's the case here though).

share|improve this answer

Looking at the answer in question, you already did the right thing in this situation: you challenged the downvote by asking for clarification in the comments under your answer, and as it turns out the downvoter decided to reveal himself, explain his downvote, and you talked him round.

In the event that the downvoter had opted to remain anonymous, though, the correct course of action would have been to suck it up and move on. If your answer is good and the downvote didn't prompt you to review your answer and identify any potential issues, then don't worry too much about it - it's just a downvote, and if you're right then others will upvote you and over time the situation will correct itself.

However, I wouldn't suggest posting to Meta and calling out the user as you did just because someone disagrees with your answer. That's a relatively extreme reaction to a single downvote.

share|improve this answer

Your answer was actually the fifth (as if that mattered, those five answers came inside 20 seconds), and several of the earlier answers contained the advice to change the parameter name to fix the issue. IMO the better fix.

Still, although your code is in my opinion unnecessarily complicated, it's valid, so I wouldn't downvote it. Perhaps the downvoter (maybe glglgl) thought too complicated code wasn't helpful.

You can't do anything to prevent unwarranted downvotes, so you just have to put up with them.

Note that all the other answers to that question were downvoted too without good reason. The downvoter later decided to undo the downvotes to four of the answers, unlike the downvotes on your and glglgl's answer, though.

share|improve this answer

If an answer works, it works. The only time I'd downvote if is there's something seriously wrong with how it works (doesn't answer the question, opens up a serious security hole, etc). Given the community-driven nature of SO, you'll have to deal with bad apples sometimes, and there's no way to prevent that. Fortunately, it's a large community, and there's FAR more good apples than bad ones. Keep answering/editing, and it'll all even out.

Asking the downvoter for clarification is good, but usually they won't respond (as I've found). You're fortunate that he did.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .