我正在尝试使用此函数初始化一个二维数组
void initialize(int n,int m, float **v){
v = malloc(n * sizeof(float *));//problem here
int i,j;
for (i=0; i<m; i++) {
v[i] = malloc(m * sizeof(float));//problem here
}
for(i=0 ;i<n; i++){
for(j=0 ;i<m; j++){
v[i][j] = rand()%11;
}
}
}
我收到此错误
error: a value of type "void *" cannot be assigned to an entity of type "float **"
error: a value of type "void *" cannot be assigned to an entity of type "float *"
有什么问题吗?