[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] C (was: QA uploads primer)



On Ter, 16 Jun 2009, Stefanos Harhalakis wrote:
[snip]
Of course you need to look at the C spec to
claim that you understand C in depth (you did... didn't you?) and in order to
understand why

int n=1; int main() { n=n; printf("%d", n); }

will not output '1'

[snip]

I couldn't figure why it wouldn't output 1, so I tried (with gcc 4.2.3) and it did print "1". :-) Surely it complains about printf not being defined previously, but it works and since the parameters happen to be correct (even though the compiler does not know that), the correct output is printed.

So I'm still curious why you say it would not work. Care to explain?


--
Eduardo M KALINOWSKI
eduardo@kalinowski.com.br


Reply to: