这是我想要做的:
//Define a structure to store multistep sequences.
struct Command
{
int Steps; //Number of steps in the seq
int StepCount; //must be set to -1
int Seq[Steps][NUMSERVOS + 1];
};
例如,Command
初始化可能如下所示:
Command Home = {1,-1,{90, 90, 90, 90, 90, 90, 1000}};
该行将导致 intArray Seq
的大小为[7][1]
( NUMSERVOS == 6
)
我想Array Seq[][]
用Steps
.
问题是:
Steps
不是一个常数整数。Steps
不是静态的。
无论如何我可以使用在数组之前初始化的成员为数组动态分配内存吗?