Hi!
I was looking a lot about that, but i didn't find any answer so I decided to ask here.
I have a function:
and i want to write some values into the matrix so:
somebody can help?
thanks!
I was looking a lot about that, but i didn't find any answer so I decided to ask here.
I have a function:
Code:
void allocate(double **m,int n) {
int i;
m=(double**)malloc(n*sizeof(double *));
for(i=0;i<n;i++)
m[i]=(double*)malloc(n*sizeof(double));
}
Code:
int main() {
double ** m
allocate(m,3);
m[1][2]=2; '\* Here I have a segmentation fault
}
thanks!
Comment