小编kev*_*iss的帖子

C - 访问stuct数组

我有一个基本的问题,我不能为我的生活弄清楚.新来的C所以请耐心等待.

首先,我创建一个结构数组:

struct rule {
    int  *in;       /* ingress flag */
    int  *out;      /* egress flag */
    char *actionvalue;  /* actionvalue BLOCK or UNBLOCK */  
    char *proto;        /* protocol e.g. UDP TCP ICMP */    
    char *ip_src;       /* source and dest address */
    int  *srcport;      /* src port */
    char *net_src;      /* source and dest netmask */   
    char *ip_dst;       /* source and dest address */   
    int  *dstport;      /* dst port */
    char *net_dst;      /* source and dest netmask */   
} rulelist[10]; …
Run Code Online (Sandbox Code Playgroud)

c arrays struct pointers

0
推荐指数
1
解决办法
118
查看次数

标签 统计

arrays ×1

c ×1

pointers ×1

struct ×1