I have an opaque type in my library that is defined as:
typedef struct MyOpaqueType* MyType;
I cannot pass the structure of a pointer to const using typedef, so some functions look like this:
void UsePointerToConst ( const struct MyOpaqueType * )
instead:
void UserPointerToConst( const MyType )
So, considering this, I have two questions: Is the struct keyword in the parameter list only necessary in C? Is there a better way to do this? Should I create a typedef, for example:
typedef const struct MyOpaqueType* ConstantMyType; ?
source share