Disruptive
Programmer
void mycreatedynamicstorage(int **MyArray)
{
by malloc -allocate some 2D storage for the variable above.
}
void populatestorage(int **MyArray)
{
Simply populate the sample.
}
int main(void)
{
int **MyArray;
mycreatedynamicstorage(MyArray);
populatestorage(MyArray);
}
My question comesdown to storage class. I have following set-up. The create routine works as it should and creates an array,
but when it is sent to the next function it seems that I get a segmentaion fault and it would appear the array has gone
missing. Should I use a storage class for this. Now these routines are tested and work if I dont not explicity call the arrays
in the function and place the int **MyArray out of the main and into global. Please help if you can, I would send the code, but
I amworking on Linux without a connection so have had to type in the salient points. Thanks
{
by malloc -allocate some 2D storage for the variable above.
}
void populatestorage(int **MyArray)
{
Simply populate the sample.
}
int main(void)
{
int **MyArray;
mycreatedynamicstorage(MyArray);
populatestorage(MyArray);
}
My question comesdown to storage class. I have following set-up. The create routine works as it should and creates an array,
but when it is sent to the next function it seems that I get a segmentaion fault and it would appear the array has gone
missing. Should I use a storage class for this. Now these routines are tested and work if I dont not explicity call the arrays
in the function and place the int **MyArray out of the main and into global. Please help if you can, I would send the code, but
I amworking on Linux without a connection so have had to type in the salient points. Thanks