CS153/hw5/hw5programs/compile_struct_array.oat

14 lines
233 B
Text
Raw Normal View History

struct Test {
int[] xs;
int y;
int[] zs
}
global arr_x = new int[] {3,4,5};
global arr_z = new int[] {4,5,6};
int program(int argc, string[] argv) {
var t = new Test {xs=arr_x; y=3; zs=arr_z};
return t.xs[0] * t.zs[1];
}