3 ms·
Beware that this is very much not a "C Integer quiz", but a "ILP32/LP64 Iinteger quiz". As sono as you move not to some weird exotic architecture, but simply to
by lultimouomo 4y ago
Beware that this is very much not a "C Integer quiz", but a "ILP32/LP64 Iinteger quiz". As sono as you move not to some weird exotic architecture, but simply to 64bit Windows(!!) some quiz answers will not hold.
For a website meant to educate programmers on C language gotchas, this is a pretty lackluster effort.
Even the initial disclaimer, "assume x86/x86-64 GCC/CLang", is wrong, as the compiler does not have anything to do with integer widths.
- deleted 4y ago[deleted]
- flykespice 4y agoMy impression is this wasn't muxh to educate programmers on C language gotchas but to remind you just how messy and fragile this language is (so you can stay far away).
- lultimouomo 4y agoOne more reason not to give the impression that you can assume that long is wider than int which is wider then short!
- ok123456 4y agoThe quiz is wrong because they assume that the length of short is less than int in some questions. A short can be the same length as an int. It just can't be longer.
- ninefathom 4y agoI noticed this when I got to some of the x86 vs. x86-64 questions. Occasionally I'll tutor C and C++ to college students, and I swear that I spend half of my time in such cases correcting erroneous (or absurdly incomplete) info provided by instructors, Stack Exchange articles, etc. It's especially challenging when I get, "but I read it on HN?!"