Kai-Uwe Bux said:
We just face some possibilities:
a) the OP asked a non-senscal question.
There are two very different variants of that
a1) the OP intentionally asked a question they knew to be non-sensical
a2) the OP asked what is actually a non-sensical question but believed
they were asking a meaningful question
Unless the OP was deliberately trolling, a1 is not the case. However,
given the number of people here (and in the real world) who use the
phrase "C/C++" and later reveal a mistaken belief that the distinction
between C and C++ is irrelevant to their question, or even a failure to
understand that the two are sufficiently different that, for all but
the most trivial of questions, the answer in C and the answer in C++
may bear no resemblance to each other, a2 is a definite possibility.
b) some other posters offered a non-sensical interpretation of the original
question because they take offense in the string "C/C++" for whatever
reasons.
I've seen "C/C++" used to mean at least three different things and
rarely is it clear from the context which is meant:
1) I need one solution that will work in both C and C++.
2) I need either a solution in C or a solution in C++. I understand the
distinction and I expect that the C solution would differ from the C++
solution and that the C solution might not work in C++.
3) I need one solution in the language I'm using and I had no idea that
C and C++ were distinct, either formally or idiomatically.
3 is not uncommon and that lack of understanding produces the sort of
hotch-potch of C and C++ code that gets posted here all the time.
Having to work with code like that is frustrating and is probably the
cause of some people's (mine included) irritation at the use of the
term "C/C++".
In interpretation, as in translation, there is a prima-facie principle: if
an interpretation (or translation) renders a phrase patently wrong or
meaningless or non-sensical, chances are that the interpretation is
mistaken. The goal of interpreting some statement or question should be
understanding not ridicule.
The possibility here is that interpretation that rendered the question
patently wrong could well have been exactly the right interpretation
because of a lack of understanding on the questioner's part.
Notwithstanding the irritation caused, it is undoubtedly more
constructive to educate away the misunderstanding (if misunderstanding
is the reason "C/C++" was used) than to ridicule.
Given that the use of "C/C++" to mean the non-sensical and mythical
combination of the two is not uncommon, I would advise anyone who does
understand the similarities and differences to be explicit to avoid
appearing uneducated. Make it clear whether you mean "an answer in C or
an answer in C++ is sufficient" or "I need an answer that will work in
both C and C++".
Gavin Deane