3 ms·
Here's another gem: int allocate_memory(void) { int *matrix; if (!(matrix = malloc(sizeof(int) * 9))) // this is short for matrix =
by spacechild1 5y ago
Here's another gem:
int allocate_memory(void)
{
int *matrix;
if (!(matrix = malloc(sizeof(int) * 9))) // this is short for matrix = malloc(sizeof(int) \* 9; if (matrix == NULL)
return NULL; // the malloc is now protected,
return matrix;
}