Live data from Hacker News

C’s Biggest Mistake (2009)

digitalmars.com

381–382 of 382 posts

Re: C’s Biggest Mistake (2009)

#381

Stupid question, but how do I access the size of an array using this fancy new declaration if it were to be added? It doesn't seem like any sugar is there to provide "range based for loops." Wait I would just use `sizeof` but then I'm still doing pointer math then?

    #define ARRAY_SIZE(x) ((sizeof x) / sizeof *(x))
But ideally there would be a builtin to do this, since this gives nonsense results if you pass a pointer instead of an array.

Re: C’s Biggest Mistake (2009)

#382
post #216

Earlier quoted context omitted.

> Google the name of the person before responding to them Is it a rule at HN that you can't take someone else's name? Otherwise, there's no guarantee that you're talking to the "Real" Walter Bright... ... or that you're talking to that Walter Bright, come to think of it.

I’m new here, so this seems like a valid criticism to me — but judging by the number of downvotes, it may not be. Can someone explain why this comment is incorrect?

It's fair argument but I also check karma point is high so it looks like legitimate account name in this case.
Post reply on HN