Never, repeat
NEVER create a C++ object using malloc(), and
NEVER attempt to copy it around using memcpy(). Unless you relish the prospect of undefined and unpredictable behaviours.
Code:
extern "C" void *INT_SET_NEW()
{
return new int_set();
}
The point is the
implementation of this function has to be compiled with a C++ compiler, otherwise it cannot access C++ objects or types. You can't implement it using C code only (unless you use techniques that are specific to your particular compiler which, practically, is rather pointless).
Practically, it needs to be accompanied by a header file, which can be #include'd in a C source file and compiled with a C compiler, so the function can be called from C code. That header will generally declare the function but not implement it. That header also can not declare any C++ specific types or variables or use C++ specific headers - if it does, it will be impossible to compile it as C.