sizeof single struct member in C

后端 未结 9 2173
礼貌的吻别
礼貌的吻别 2020-11-30 17:13

I am trying to declare a struct that is dependent upon another struct. I want to use sizeof to be safe/pedantic.

typedef struct _parent
{
  floa         


        
9条回答
  •  粉色の甜心
    2020-11-30 18:02

    You can use a preprocessor directive for size as:

    #define TEXT_MAX_SIZE 255
    

    and use it in both parent and child.

提交回复
热议问题