I want to create multiple arrays based on the iterations of a loop in C.
For example:
int i, size;
for ( i =0; i< 10; i++)
{
size = i * 100
create_array(i,size); // This loop iterates 9 times creating 9 different arrays
}
void create_array(int name, int size)
{
double *array_name = (double*) malloc (size*sizeof(double));
// perform operations on array_name
}
Therefore we end up with 9 arrays namely array_0,array_1, .... array_9. Can this be accomplished in C or Fortran (not C++)?
array_name
fromcreate_array
. Where do you want to have array_0, array_1 etc.? – taskinoor Jun 19 '13 at 15:11