关于MIB结构体的问题,请大家赐教

C语言 码拜 8年前 (2016-04-23) 981次浏览
部分代码如下,主要不太明白”ipa_rn = (struct mib_list_rootnode*)(ipa_n->nptr);“这句话的含义:
struct mib_node
{
u8_t node_type;
/* array or max list length */
u16_t maxlength;
};
struct mib_list_node
{
struct mib_list_node *prev;
struct mib_list_node *next;
s32_t objid;
struct mib_node *nptr;
};
struct mib_list_rootnode
{
u8_t node_type;
u16_t maxlength;
/* additional struct members */
struct mib_list_node *head;
struct mib_list_node *tail;
/* counts list nodes in list  */
u16_t count;
};
int main(void)
{
struct mib_list_rootnode *ipa_rn;
struct mib_list_node *ipa_n;
ipa_rn = (struct mib_list_rootnode*)(ipa_n->nptr);
}
解决方案

20

指针类型转换

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明关于MIB结构体的问题,请大家赐教
喜欢 (0)
[1034331897@qq.com]
分享 (0)