v2x asn1c SEQUENCE_OF使用
直接上代码,asn文件如下:
ASN Example
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
StructWList ::= SEQUENCE OF ListItem
ListItem ::= INTEGER
END
c/c++ Example
int main()
{
ListItem_t *li = nullptr;
StructWList_t swl = {0};
swl.list.count = 0;
swl.list.size = 0;
li = reinterpret_cast<ListItem_t*>(calloc(1, sizeof *li));
ASN_SEQUENCE_ADD(&swl, li);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_StructWList, &swl);
}
本文链接地址:https://const.net.cn/143.html