opaque-pointers

Trouble using opaque pointers in Objective C++

The answer to this quesion explains that opaque pointers are a good way to include C++ member variables in an Objective C++ header. I'm getting compile errors when trying to follow the example. Here's the relevant code from my header, with the corresponding compiler errors shown as comments: struct ADSR_opaque; // error: forward declara...

C/C++ opaque pointer library

hello Is there library/header already written to manage C++ objects from C using opaque pointers/handles? I can write one myself, but I would rather use already made solution, especially if it has fortran bindings. my specific requirements are: wrapper generation facility (my thought is to use boost preprocessor) handling objects th...

Opaque C structs: how should they be declared?

I've seen both of the following two styles of declaring opaque types in C APIs. Is there any clear advantage to using one style over the other? Option 1 // foo.h typedef struct foo * fooRef; void doStuff(fooRef f); // foo.c struct foo { int x; int y; }; Option 2 // foo.h typedef struct _foo foo; void doStuff(foo *f); // fo...