News for hackers. Stuff that matters.
Re:So you think you know C? by kmill on Wednesday November 09, 2016 @12:28AM (#12906341)
The question is "what would the return value be," and without knowing which compiler is used you don't know what it would return. It doesn't make sense to say the program returns "undefined behavior" or "implementation-dependent."

You might be taking issue with the question itself, but I think it's a valid question because C compilers tend to be lenient with what they compile.

Re:So you think you know C? by gkya on Wednesday November 09, 2016 @02:35AM (#12907188)
I can't know != I don't know
Re:So you think you know C? by amelius on Wednesday November 09, 2016 @05:56AM (#12909149)
Yes, and "I can't know" is a stronger assertion than "I don't know". The former implies the latter. However, both are correct.
Re:So you think you know C? by gkya on Wednesday November 09, 2016 @08:59AM (#12910259)
Thing is I can know if the necessary information is provided (i.e. CPU architecture, version of the standard). Portability is a feature of C, but C's portability is mostly syntactic and only partly semantic.
Re:So you think you know C? by jwdunne on Thursday November 10, 2016 @02:06AM (#12918342)
But if the necessary info isn't provided, you don't know because, as you say, you can't know.

It's semantics. On many exams, "don't know" is a correct answer when you can't know because info is intentionally left out.

Re:So you think you know C? by gkya on Thursday November 10, 2016 @10:42AM (#12921303)
I don't really want to be a pedant here, but in this case if the necessary information was provided, I had the knowledge to find a correct answer. This is different from the case where even if the information was provided I wouldn't be able to know because I don't have the necessary knowledge.