3 ms·
Why use two files instead of one?
by rytill 5y ago
Why use two files instead of one?
- bluedino 5y agoWhat if you want to use the functions in other C files? What if you want to compile them all separately?
- hn_acc_2 5y ago1) Include it wherever it's used. The convention is to use the preprocessor[1] so it only appears once in the final binary 2) Most developers just want to compile to a single binary. Any developer who for some reason needs separately compiled objects should be able to quickly achieve that from a single-file library [1] https://github.com/phoboslab/qoi/blob/324c2243b2fb35f741a88d73ae10c132ccbba0b1/qoi.h#L158-L159 https://github.com/phoboslab/qoi/blob/324c2243b2fb35f741a88d...