Как сделать элементы структуры закрытыми?

I define a structure in a header file like so:

typedef struct {
    void *data;
} point;

I want to keep other people from accessing *data directly, so I thought I'd declare the structure in the .c file instead and use something like extern typedef struct point; in the header file. That doesn't work however.

What's the best way to achieve this?

6
задан matthias krull 20 March 2011 в 15:51
поделиться