Hacker News new | past | comments | ask | show | jobs | submit login

This is why C is sort of unassuming in its "sizeof arr / sizeof *arr" pattern.

Whenever you write a new type, just write a sizing function for it using sizeof. I like that Go is taking a similar route, except that one just implements the signature.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact