Is this a good or a bad question?
What makes this a good/bad question?
Should this question be closed and, if so, what's the appropriate close reason?
I believe this question was unclear and lacked a MCVE, and is now a typo. The OP asks why C++'s auto
keyword wasn't working properly, and the answer is that he was using C, not C++. The "bug" was with how he was compiling the program, not anything with the code he provided.
Before revision 17, the question was unclear and lacked an MCVE. The provided snippet did not reproduce the problem, since the problem was with how he was compiling (which he did not specify).
In revision 17, the OP finally clarified that he compiled the code as C. I would argue that the question is now a typo, as it was resolved in a manner that is unlikely to help future visitors. Someone else with the same problem is fairly unlikely to notice it while adding a float
and an int
-- it's possible, but there's dozens of other ways this problem could manifest itself. If someone else mistakenly compiled C++ code as C, how likely are they to google "Why is the sum of an int and a float an int?"
Which tags are appropriate for the question?
I don't have much of an opinion on this, but I'd say both c and c++ are appropriate since the OP meant to use C++, but was using C. The question was not solely about either of the languages; it involved both.
Should the asker gain reputation from this question?
I don't believe the question deserved that many upvotes, but there's not much we can do about it.
Should the answerer gain reputation from their answer?
Yes. Even though it's a poor question, the answer is good answer, and the answerer should receive reputation from it.