logoalt Hacker News

dwrobertstoday at 6:58 AM1 replyview on HN

> First of all, structs aren't used so you don't have to invent names for them (e.g. there is no IntVec)

But since it’s storing a void pointer any way, they wouldn’t need separate names right? You could use one struct everywhere regardless of the type of the items

Which IMO is a better idea than using an array here because the fields can be properly named and typed to prevent accidental misuse


Replies

sparkietoday at 7:25 AM

If you use a struct with a `void*`, you also need to specify the type on usage, where here it's done with `typeof`.