3 ms·
There are other data types besides pointers to structs. Specifically, stdint.h data types are a good example (on linux). int myfunction(uint64_t arg0); W
by drblast 16y ago
There are other data types besides pointers to structs. Specifically, stdint.h data types are a good example (on linux).
int
myfunction(uint64_t arg0);
When writing cross-platform code, there are typically a lot of these kinds of things going on.
Also, I typically include data type definitions in header files if they're used in more than one context. If I define a new data type in a header file that depends on other data types, I have to include those headers in the header file.
Let's say I'm writing an encoder/decoder for a protocol and I want to separate the encode functions from the decode functions. Maybe they're in separate programs. They'll both use the same data structures for the most part.
It it's a network protocol the layers of dependencies can get pretty deep.
This isn't a problem with a one-liner solution, it's "how do you structure a huge project to reduce weird dependency issues when compiling while keeping the code readable?"