Files
cs420/examples/c/struct.c
Janggun Lee 72dadc608d Various quality-of-life improvements (ideas from @33577 )
* Very basic `hello_main.c`
* Big starting hint to `write_c`
* Better error messages on failed test
  * TODO: also improve it for asmgen, but not sure how to do it in a good way
2025-02-25 00:28:55 +09:00

27 lines
415 B
C

typedef struct {
char a;
struct {
int b[4][5];
};
double c;
} Temp;
void init(int row, int col, int arr[4][5]) {
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
arr[i][j] = i * j;
}
}
}
int main() {
Temp temp;
int row = 4, col = 5;
init(row, col, temp.b);
Temp temp2;
temp2 = temp;
return temp2.b[2][3] == 6;
}