[Solved] C – program crashes when using free function
The errors in the code is: M == NULL is not a valid way to check if malloc is succeeded. You should use (*M) == NULL because the value is assigned to (*M), not M. The loop condition in ReservarMemoriaMatriz i<=m seems wrong. It should be i<=n. You forgot to free (*M)[n] in LiberarMemoriaMatriz. Corrected … Read more