Remix.run Logo
zoezoezoezoe 2 days ago

technically, "header only libraries" can be exceptions to C code not being in header files. See STB as an example https://github.com/nothings/stb. The advantage theoretically is that you can #include this library and use its code and types from just one file, its a decent model IMHO, but it can be jarring to someone unfamiliar with header only libraries.

uecker 2 days ago | parent | next [-]

They have plenty of downsides and only one very minor advantage: You need to copy only a single file instead of two into your source. I am still puzzled why anybody could think this is a good idea...

1718627440 a day ago | parent [-]

And you also can name your single file to be included .c instead of "hiding the truth".

1718627440 a day ago | parent | prev [-]

You can include a .c file just fine.