how to use a macro of structure ?
Here I am listing steps for it by using a demo:
#define structed_define \ { "this is a demo for structed",1883 }
this is a macro for structure.
typedef struct_static { char* name; int port; } xi_static_host_desc_t;
this is a structure class
unsigned int b; char buf[32]; b=XI_MQTT_HOST_ACCESSOR.port; memcpy(buf,XI_MQTT_HOST_ACCESSOR.name,strlen(XI_MQTT_HOST_ACCESSOR.name));
End
原文:https://www.cnblogs.com/lumao1122-Milolu/p/13277560.html