kinda forces heap allocs. There are times when you want to allocate on the stack, and not use alloca.
Most of the time, I still keep struct definitions in header files, but API wise I always write functions or macros for anything that touches them and discourage direct access to struct members. Depending on the use case of course. Abstract types have their uses too.
Hiding the struct like:
kinda forces heap allocs. There are times when you want to allocate on the stack, and not use alloca.Most of the time, I still keep struct definitions in header files, but API wise I always write functions or macros for anything that touches them and discourage direct access to struct members. Depending on the use case of course. Abstract types have their uses too.