Re: Segmentation Fault Question



 So, you never initialized you path (Gstring* path;).

 Make sure you initialise you  'path' variable inside that function.


I was originally doing this with a char * variable instead and then calling realloc each time round the loop which pulls the file names from the child program's address space. I haven't yet checked it with the version using GString instead. With the char * version, why would it work if I got rid of the display() statement though? Surely if the pointer wasn't initialised properly it shouldn't affect it one way or the other whether display() is being called or not?

Mel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]