What's the main difference between a C API and a C++ one? Usually, it's not about polymorphism or having classes per se, but about an idiom called RAII.
RAII stands for Resource Acquisition Is Initialization, but it's actually more about releasing resources than acquiring them. Let's take a look at a similar API written in C and C++ to show this feature in action:
struct Resource;
// C API
Resource* acquireResource();
void releaseResource(Resource *resource);
// C++ API
using ResourceRaii = std::unique_ptr<Resource, decltype(&releaseResource)>;
ResourceRaii acquireResourceRaii();
The C++ API is based on the C one, but this doesn't always need to be the case. What's important here is that in the C++ API, there's no need for a separate function to free our precious resource. Thanks to the RAII idiom, it's done automatically once a ResourceRaii object goes out of scope. This takes the burden of manual resource management away from...