更新时间:2022-06-16 02:13:31
我的建议是首先避免多维数组的痛苦并使用结构体.
My advice would be to avoid the pain of multidimensional arrays in the first place and use a struct.
struct Point {
int x;
int y;
}
int points = 10;
Point myArray[points];
然后访问一个值:
printf("x: %d, y: %d", myArray[2].x, myArray[2].y);
不过,这完全取决于您要实现的目标.
Depends on exactly what you're trying to achieve, though.