C程序出错:error C2059: syntax error : '{'

来源:百度知道 编辑:UC知道 时间:2024/05/12 08:42:38
#define MAX_FEATURE_NUM 5
#define MAXNumber 70

typedef struct ArcBox
{
int tail,head;
struct ArcBox * hlink,* tlink;
}ArcBox;

typedef struct FeaNode
{
char * feaname;
int type;
union range
{
char * c_range[MAXNumber];
int * i_range[MAXNumber];
double * d_range[MAXNumber];
};
int indegree;
int valuenum;
int visit[MAXNumber];
ArcBox * parent,* child;
}FeaNode;

typedef struct
{
struct FeaNode fealist[MAX_FEATURE_NUM];
int feanum,arcnum;
}BayesNetwork;
void InitNB (BayesNetwork * nb)
{
(* nb).fealist[MAX_FEATURE_NUM]=
{{"duration",1,{0,1},0,2,{0},NULL,NULL},
{"protocol_type",0,{"icmp","tcp","udp"},0,3,{0},NULL,NULL},
{"src_bytes",1,{0,150,450,5000},0,4,{0},NULL,NULL},
{"dst_bytes",1,{0,150},0,2,{0},NULL,NULL},

(* nb).fealist[MAX_FEATURE_NUM]=
{{"duration",1,{0,1},0,2,{0},NULL,NULL},
{"protocol_type",0,{"icmp","tcp","udp"},0,3,{0},NULL,NULL},
{"src_bytes",1,{0,150,450,5000},0,4,{0},NULL,NULL},
{"dst_bytes",1,{0,150},0,2,{0},NULL,NULL},
{"land",1,{0,1},0,2,{0},NULL,NULL}};
改用for循环赋值

你的没有主函数

程序风格不好啊