3 ms·
You can create a pointer with a type but no storage definition. // foo_t is opaque typedef struct foo_s foo_t; // function defined taking an opaque p
by Gibbon1 4y ago
You can create a pointer with a type but no storage definition.
// foo_t is opaque
typedef struct foo_s foo_t;
// function defined taking an opaque pointer
int Baz(foo_t *f);
// actual definition
typedef struct foo_s
{
int bar;
} foo_t;
// function def
int Baz(foo_t *f)
{
return f->bar;
}