【发布时间】:2014-12-10 21:52:22
【问题描述】:
我有一个问题:
NXC中有这样一个struct函数:
struct colorType
{
int colorval;
unsigned int rawRed;
unsigned int rawGreen;
unsigned int rawBlue;
unsigned int normRed;
unsigned int normGreen;
unsigned int normBlue;
};
colorType cubeColor[6*9];
我在 F# 中创建了相同的结构,如下所示:
type colorType =
struct
val colorval: int
val rawRed: uint16
val rawGreen: uint16
val rawBlue: uint16
val normRed: uint16
val normGreen: uint16
val normBlue: uint16
end
但我不知道如何在 F# 中调用 colorType cubeColor[6*9];。
你能帮我处理这个案子吗?
谢谢。
【问题讨论】:
-
你想创建一个归零的结构数组吗?
-
其实重点是,我正在尝试在 F# 中再次编写 NXC 代码。但我无法理解 NXC 中 struct 的意义。在写colorType cubeColor[6*9]的时候,struct中的哪些值被调用。
-
@yeniden - 正如丹尼尔所说,这只是一个归零的结构数组
-
那我现在能做什么?你有什么想法吗?