Quote:
Originally Posted by McCoder
Code:
158 getline(in_fname);
|
What version of
getline is that supposed to be?
So far as I can infer from other details in your post, it is the one documented here:
http://www.gnu.org/s/libc/manual/htm...ine-Input.html
But if that is it, then you are calling it incorrectly.
First notice that it takes three parameters, not one.
Also notice that the first parameter is not the result variable (as you seem to have passed). C doesn't support "call by reference", so a parameter can't be the result variable. The first parameter is the
address of the result variable.
Quote:
Can someone give me more insight on segmentation faults and GDB so I can fix this problem?
|
That would be a lot to teach. I don't think you're ready.
It should be obvious that the info you got from GDB tells you something went wrong inside a function called from line 158 of your dmsp_cusp.c.
An expert using GDB could figure out quite a lot about what went wrong and why.
But even an expert would first look at line 158 and see if anything is obviously wrong with it.
Since line 158 is obviously wrong (as I described above) there is no reason to try any more advanced use of GDB to dig out more details.