I'm writing a program to look at very large data sets. When I wrote the program to use a 3-d linked list, the thing did not finish over 3 days. I'd like to use arrays to take advantage of indexing, but there are very few computers that have enough ordered memory...
Anyway, to my point:
I have an array of linked list pointers, with each node in the first list pointing to a second (I have some knowledge about how my data will look, but not that much).
When I run my program, I get a nice segmentation fault. I tried running it in GDB and get this odd message: "Program received signal SIGSEV ... at line 299"
what it's referring to is this part of the code, which I call before (although I'm not making more than one list node from the array before I make a list of points.
while(mag->next != NULL && mag->next->r < r_rB )
This program is very long, but I'm not sure why it's faulting here. I wrote very similar code using random inputs for a small sample size and everything worked fine. I guess inputing 4000^3 points is difficult, but I think something is funny with my code. Any help is appreciated.
rowH v1,mag = magArr[r_rA];
if(mag == NULL)
if( (mag = (rowHeader *) malloc(sizeof(rowHeader))) == NULL)
printf ("Out of Memory!\n");exit(0);
mag->next = NULL;
mag->point = NULL;
mag->r = r_rB;
while(mag->next != NULL && mag->next->r < r_rB ) //faults here
if(mag->r == r_rB)
mag = mag->next;