5 ms·
This is crap. 1e: this is undefined behavior (-Wsequence-point) x can be literally anything. 3. a typical mistake that the compiler both warns about and that
by rmserror 14y ago
This is crap.
1e: this is undefined behavior (-Wsequence-point) x can be literally anything.
3. a typical mistake that the compiler both warns about and that anyone who has taken a course on C should be able to immediately recognize
bonus 1. void main(int)???
- DerekL 14y agoQuestion 1 asks about syntax. The behavior of the code is irrelevant.
- TwoBit 14y agoExcept for the the fact that the author writes: "for bonus points, if x is 1 before 1e, what is x after that line?"
- epidemian 14y agoThen wouldn't an answer like "x could be anything because of undefined behavior" be correct? This test is indeed quite evil, especially considering it was for freshman students. I have to admit, though, that the bonus question was great.