Re:Everything I wish I knew when learning C
by layer8 on Monday November 28, 2022 @10:44AM
(#33774971)
You can declare a type without (fully) defining it, like in
and then have code that (for example) works with pointers to it (*foo_t). If you include a standard header containing such a forward declaration, and also declare foo_t yourself, no compilation error might be triggered, but other translation units might use differing definitions of struct foo, leading to unpredictable behavior in the linked program.
[ Parent
| on HN ]
There are no comments on this comment yet.