assertion problem when I entering numbers into the matrix
I've already checked that the matrix has been properly allocated
matrix = alloc_matrix(row, cols);
printf("enter number to matrix\n");
int i, j;
for (i = 0; i < row; i++)
{
for (j = 0; j < cols; j++)
{
scanf_s("%d", matrix[i][j]);
}
}
void main() {
int row, cols;
int **matrix;
printf("pleaese enter a row \n");
scanf_s("%d", &row);
printf("pleaese enter columns\n");
scanf_s("%d", &cols);
matrix = alloc_matrix(row, cols);
printf("enter number to matrix\n");
int i, j;
for (i = 0; i < row; i++) {
for (j = 0; j < cols; j++) {
scanf_s("%d", matrix[i][j]);
}
}
system("pause");
}
assertion failed