Kushal Das

FOSS and life. Kushal Das talks here.

The small big problem..

Learning C from 2nd Sem.. Thought can explain the basics.. But when I tried to explain a very basic code to the first years in college, I was clean bowled. The code: #include int main() { int i=5; printf (”\n%d %d %d\n”,i,i--,++i); } According to my knowledge it should give 5 6 6. But it gave 5 6 5.. Why? I don’t know… today in office, me,naresh & Arvind tried to figure out what is happening.. It is giving 5 6 6 up to GCC 4.0.0 version (as informed by Monuda), but in GCC 4.0.2 .. we can’t explain the result.. Any one help me………………….

comments powered by Disqus