float m[float];
m[4.1] = 5.5; //key is 4.1 (float) and value is 5.5 (float)
m[5.3] = 6.6;
刘表write ("4.1 is mapped to %2.2lf", m[4.1]);
write ("5.3 is mapped to %2.2lf", m[5.3]);
for (float mykey : m)
投资学论文
{
write("%2.2lf is mapped to %2.2lf.", mykey, m[mykey]);
}
example 2:关联字符串
char[30] namen[char []];
罗俊杰思想政治考核评语
strncpy(namen["Max"], "Mustermann", 30);
strncpy(namen["Vector"], "Informatik", 30);
for (char[] mykey : namen)
{
write("%s is mapped to %s", mykey, namen[mykey]);
}
酸笋的腌制方法
王维的山居秋暝4 结构体
结构的定义和使⽤同C:
variables
{
struct Point
{
int x;
int y;
};
struct Point myPoint;
struct Point allPoints[50];
}
on start
{
金的繁体字怎么写myPoint.x = 7;华为的冬天
myPoint.y = 2;
allPoints[3].x = 1;
allPoints[3].y = 5;
}
注意: CAPL中结构体默认按8字节对齐,可以在结构体定义前加_align来改变结构体对齐⽅式。example:
2 流程控制