Il codice dovrebbe essere
codice:
void matalloc(unsigned char ****m, int r, int c, int p)
{
int i,j;
*m = (unsigned char ***)malloc(r * sizeof(unsigned char **));
for(i = 0; i < r; i++)
{
(*m)[i] = (unsigned char **)malloc(c * sizeof(unsigned char *));
for(j = 0; j < c; j++)
(*m)[i][j] = (unsigned char *)malloc(p * sizeof(unsigned char));
}
}
Fai attenzione all' unsigned char al posto del char
Chiaramente, mancano tutti i controlli sulla effettiva riuscita di tutte le malloc ... dovrai aggiungerli tu ...