主题:请教:vc中自定义结构体的初始化的问题
在vc中自定义一个point结构体,但初始化时报错:
struct point
{double x;
double y;
};
point p={3,5};
报错提示:
initialization of 'p' is skipped by 'case' label
see declaration of 'p'
请教高手,在vc中难道初始化一定要一个元素一个元素的赋值吗?并且如下赋值也不行:
struct point
{double x;
double y;
}point p={3,5};
请教高手,这个问题该如何解决?
struct point
{double x;
double y;
};
point p={3,5};
报错提示:
initialization of 'p' is skipped by 'case' label
see declaration of 'p'
请教高手,在vc中难道初始化一定要一个元素一个元素的赋值吗?并且如下赋值也不行:
struct point
{double x;
double y;
}point p={3,5};
请教高手,这个问题该如何解决?