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.

Applications are open for YC Summer 2020

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