Brixpath::Brixpath(){
{ _animationOptions = (AnimationOptions){5, 3, 40, 30};
};
当我运行这个代码块 VS 给出错误
AnimationOptions 上不允许使用 typename。
当我删除类型名时
Brixpath::Brixpath(){
{ _animationOptions = {5, 3, 40, 30};
};
VS2010 在第 2 行的第一个“{”处给出错误
错误:需要一个表达式
动画选项的定义是-
struct AnimationOptions {
int maxClicks; //how many clicks animation on screen to support
int step; // animation speed, 3 pixels per time
int limit; //width of animation rectangle. if more, rectangle dissapears
int distance; //minimum distance between previous click and current
};
我该如何解决这个错误?请帮忙。