指针数组:
char *ifname[5] = {0};
char *port_num[10] = {0};
for(i=0; i
ifname[i] = (char*)malloc(32);
memset(ifname[i], 0x00, 32);
port_num[i] = (char*)malloc(4);
memset(port_num[i], 0x00, 4);
}
for(i=0; i
if(ifname[i] != NULL)
{
free(ifname[i]);
}
if(port_num[i] != NULL)
{
free(port_num[i]);
}
}
for(i=0; i
if(netns_port_mac[i] != NULL)
{
free(netns_port_mac[i]);
}
if(netns_port_num[i] != NULL)
{
free(netns_port_num[i]);
}
}
阅读(1348) | 评论(0) | 转发(0) |