How to export a C API from a C++ code
·864 words·5 mins
C is the lingua franca of platform APIs. Most if not all languages provide a mechanism to import APIs from C because they need to do so in order to support the operating system. But given the expressiveness of C++, its often nice to write this code in C++ instead; here’s how to do that sanely.