2 avr. 2016 · You may also use calloc, which will additionally zero initialize the matrix for you. The signature is slightly different: The signature is slightly different: int *mat = (int *)calloc(rows * cols, sizeof(int));.