Is there any workaround for making a structure member somehow 'private' in C?

后端 未结 4 1547
清歌不尽
清歌不尽 2020-12-25 08:52

I am developing a simple library in C, for my own + some friends personal use.

I am currently having a C structure with some members that should be somehow hidden fr

4条回答
  •  清歌不尽
    2020-12-25 09:19

    Marcelo Cantos has already given you the answer. For more detailed information, you should look at how FILE structure is effectively hidden in most of the uderlying libraries.

    You would have noticed that the FILE structure in itself is never available to the user, only the interfaces and an Opaque FILE * is available to us.

提交回复
热议问题