I have a pointer object consisting of different arrays of variable length. I want to get one of the arrays from the pointer array and store is in a different array. How would I go about doing it? When I try the method, it gives an error: initialization with '{...}' expected for aggregate objects which I assume means I am trying to convert from pointer to array type. Any ideas?
Here is a partial code.
int actionsfromA [] = {stateB, stateD};
int actionsfromB [] = {stateA, stateC, stateE};
int actionsfromC [] = {stateC};
int actionsfromD [] = {stateA, stateE};
int actionsfromE [] = {stateB, stateD, stateF};
int actionsfromF [] = {stateC, stateE};
// main arrays of states actions pairs
int* actions[] = {actionsfromA, actionsfromB, actionsfromC, actionsfromD, actionsfromE, actionsfromF};
void run()
{
// rand() =
for (register int i = 0; i<1000;i++)
{
int state = rand () % stateCount;
while (state != stateC)
{
int *actionsFromState [] = actions [state];
}
}
}