I declare an array and create memory for it.
I declare an array and create memory for it.
The send it to a function void readdata( char ****averages4 ...
but when I try to right to it ( or at least read from it) I can only access the zeroth row on each page.
strcpy(averages4[*i4][1][5],arr[18]); does not work or
printf("%s \n", averages4[*i4][1][5]);
does not print a value. printf("%s \n", averages4[*i4][0][5]); does.
Code:
char ****averages4;//[1500][5][45][8];
for( i = 0; i <1500; i++)
{
if ((averages4[i] = (char ***) calloc(5, sizeof(char**))) == NULL)
{
printf("no memory");
return(0);
}
for( j = 0; j < 5; j++)
{
if ((averages4[i][j] = (char **) calloc(45, sizeof(char*))) == NULL)
{
printf("no memory");
return(0);
}
for( k = 0; k < 45; k++)
{
if ((averages4[i][j][k] = (char *) calloc(8, sizeof(char))) == NULL)
{
printf("no memory");
return(0);
}
}
}
}
I declare an array and create memory for it.
Code:
char ****averages4;//[1500][5][45][8];
for( i = 0; i <1500; i++)
{
if ((averages4[i] = (char ***) calloc(5, sizeof(char**))) == NULL)
{
printf("no memory");
return(0);
}
for( j = 0; j < 5; j++)
{
if ((averages4[i][j] = (char **) calloc(45, sizeof(char*))) == NULL)
{
printf("no memory");
return(0);
}
for( k = 0; k < 45; k++)
{
if ((averages4[i][j][k] = (char *) calloc(8, sizeof(char))) == NULL)
{
printf("no memory");
return(0);
}
}
}
}
The send it to a function void readdata( char ****averages4 ...
but when I try to right to it ( or at least read from it) I can only access the zeroth row on each page.
strcpy(averages4[*i4][1][5],arr[18]); does not work or
printf("%s \n", averages4[*i4][1][5]);
does not print a value. printf("%s \n", averages4[*i4][0][5]); does.