Untitled
unknown
plain_text
3 years ago
496 B
4
Indexable
//Сюда нужно передать указатель вот такого типа: int**, кол-во строк(rows) и кол-во столбцов(cols) int matrixMemoryAllocate(int*** matrix, int rows, int cols){ int i; *matrix = (int**) malloc(sizeof(int*) * rows); if (*matrix == NULL) return 0; for (i = 0; i < rows; i++){ (*matrix)[i] = (int*) malloc(sizeof(int) * cols); if((*matrix)[i] == NULL) return 0; } return 1; }
Editor is loading...