3 ms·
C has few enough restrictions though that you can for example make a struct and then make an array of that struct. In Go this is like rocket science.
by sam0x17 5y ago
C has few enough restrictions though that you can for example make a struct and then make an array of that struct. In Go this is like rocket science.
- pphysch 5y agoWe're never going to get to Mars if `arr := [100]myStruct` qualifies as rocket science.
- hactually 5y agoWhich one are you struggling with? https://play.golang.org/p/P8L0lSMhNgF https://play.golang.org/p/P8L0lSMhNgF https://play.golang.org/p/E8rM7JdrfkD https://play.golang.org/p/E8rM7JdrfkD
- sam0x17 5y agoSorry, meant to say some other data structure, say, a hash table where the key is some custom type / struct and the value is some custom type / struct. Or a binary search tree. Or a linked list.