Static allocation of opaque data types

前端 未结 9 1058
天涯浪人
天涯浪人 2020-11-27 13:50

Very often malloc() is absolutely not allowed when programming for embedded systems. Most of the time I\'m pretty able to deal with this, but one thing irritates me: it keep

9条回答
  •  难免孤独
    2020-11-27 14:27

    It is simple, simply put the structs in a privateTypes.h header file. It will not be opaque anymore, still, it will be private to the programmer, since it is inside a private file.

    An example here: Hiding members in a C struct

提交回复
热议问题