所以我对C(以及一般的编程)很陌生,我想使用struct作为枚举的值
typedef struct {
int x;
int y;
} point;
// here's what I'd like to do
enum directions {
UP = point {0, 1},
DOWN = point {0, -1},
LEFT = point {-1, 0},
RIGHT = point {1, 0}
};
Run Code Online (Sandbox Code Playgroud)
因此,之后我可以使用枚举来执行坐标转换
如果您了解我想要实现的目标,请解释为什么这不起作用和/或正确的方法是什么?