I would like to make a memory allocation:
(*matrix)[i]=(int*)malloc(sizeof(int)*sz);

But I have got an error message: Invalid operands to binary *

What should be the problem?

how is matrix initialized? are you trying to allocate a single or a 2d array

2d array, but the problem is solved, it was caused by a pointer.