Originally Posted by
Salem
Without a COMPLETE example which you can post that demonstrates a crash, you're asking us to take part in a crap-shoot.
For a seg-fault
- you didn't initialise it
- you didn't allocate it
- you messed around with the pointer (like walked it off the end of an array)
- you freed it, then tried to access it
- you messed up the malloc size calculation to begin with
- you didn't prototype malloc to begin with
- you returned a pointer to a local variable
All these, and many more, are ways you could have screwed up.