3 ms·
I don't disagree, but I thought it was nicer for there to be a more concrete, actual memory address for the answer. I thought about explicitly stating "sizeof(
by wdaher 15y ago
I don't disagree, but I thought it was nicer for there to be a more concrete, actual memory address for the answer.
I thought about explicitly stating "sizeof(int) is 4 on this system" in the intro blurb, but that primes you a bit more than I'd like for the answer to #2, so I thought it was a little cleaner not to.
- philh 15y agoI feel that anyone who doesn't already know "it depends on sizeof(int)" isn't going to get it anyway; I was briefly thrown off because I thought "surely if sizeof(int) matters like I think it does, I would have been told what it is?" But I'm more annoyed that I failed the last two by not understanding C than that I failed the second by guessing sizeof(int) incorrectly.
- calloc 15y agoMy first instinct was that sizeof(int) was the same width as the system architecture (64 bits)... specifically because you mentioned it was a 64 bit system. Either way, after I realised that sizeof(int) == 4 the test was surprisingly simple. Are pointers really that hard to grasp?