Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s a bit confusing when compared with other programming languages. But the Zig docs’ introduction to structs are pretty clear that they can be pass-by-value or pass-by-reference at the compiler’s discretion. If you need a copy, make a copy; if you need a reference, pass a pointer; if you don’t care, the compiler will pick one.


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

Search: