So are you saying that each element in 'info' points to an array of 10 id numbers?
If that's the case, your arrays appears to be fixed at 1000 arrays of 10 elements each. Just declare the array as follows:
Or, even better, declare a constant for the number 10, in case you decide to change it:
Then just assign the numbers to their respective locations:
1 2 3 4 5 6 7 8 9
|
for (int i=0; i<MAX_ITEMS; i++) {
for (int j=0; j<MAX_LIST; j++) {
int id;
//Get the id number, however you are doing that
//Assign id
info[i][j] = id;
}
}
|
Now, if what you mean is that you'd like to assign
existing id arrays to 'info' elements, then declare 'info' as:
|
int *info[MAX_ITEMS]; //Simply declare array of pointers
|
Then when assigning to existing arrays, just set:
1 2 3 4
|
//Let pIntArray be a pointer to some array of integers
for (int i=0; i<MAX_ITEMS; i++) {
info[i] = pIntArray;
}
|
Let me know if neither of those is what you intended.