can anyone help with this segmentation error i keep getting. this code is simple but the error is so hard to figure out.
struct Link { int key; unsigned dat
The part (and everywhere &l is used)
&l
if (!srt) return &l;
is returning the address of a stack variable. Your addInOrder function should probably have the signature
addInOrder
struct Link* addInOrder(struct Link* srt, struct Link* l);