I want to multiply matrixes. I create matrix by malloc()
function. Index (variable named i
) shows NULL
, instead of number
int** matrix_a = (int**)malloc(lines * sizeof(int*));
for (int i = 0; i < lines; i++) {
if (i == NULL)
printf("'i' is NULL!");
matrix_a[i] = (int*)malloc(trans * sizeof(int*));
}
Output:
'i' is NULL!
Error:
Unhandled exception at 0x00007FF6003C35BB in MPI_C.exe: 0xC0000005: Access violation writing location 0xFFFFFFFFABA57A00.