sent[j] is not a standard A-Z character, but instead it's a space like in your example?
Consider checking, between line 22 and 23, if low is in the range a-z.
I only get the segmentation fault from the bottom for loop... is that caused by the for loop you were talking about?
Oh well, for that, try initializing "k" to 0.
You probably didn't notice it.