4 ms·
My score is 3/5. One immediate redflag I have noticed is using "int", "char", "short" as if they have a definite size. They don't. C standard only guarantees a
by bcaa7f3a8bbc 7y ago
My score is 3/5.
One immediate redflag I have noticed is using "int", "char", "short" as if they have a definite size. They don't. C standard only guarantees a minimum size. For example, many PDPs are 36-bit. Assuming the size of a variable is a common practice nowadays, but at least one should use uint8_t, int32_t, etc. from stdint.h.
But I was still tricked, it should be obvious in hindsight, 12 years of schooling led me to think: If the author was asking these questions, at least one or two questions must be answerable (even if it's technically incorrect, but you'd better to guess the original intention of a question). So I still tried to guess and got two wrong answers... Get to be careful next time...
- Raymonf 7y agoIn school, I was taught to choose the "best answer" on a test or quiz, and if you don't know something, choose the answer that looks right to you. This test.. it reverses that entirely.
- gravypod 7y agoUnfortunately the "best answer" is taken to mean "the wrong answer that the teacher programmed into you".
- scarface74 7y agoI only got two out of five. One so really didn’t know and I remembered enough C to remember sequence points.
- NohatCoder 7y agoIt is school that gets it wrong. In real life, knowing that you don't know something and acting accordingly is often way better than taking a guess.
- JKCalhoun 7y ago4/5 here. In fact after the third question provided "I don't know" as an answer I started to suspect something was up — especially since the author said only one answer was the right one ... why even provide "I don't know" then, I wondered? I knew "int" was sort of platform-dependent (was 16-bits generally when I was learning to code, later 32-bit became more typical) — so combined with that niggle and all the "I don't knows", I (correctly) reevaluated by first couple of answers. Still, didn't realize the last one was compiler-dependent.