I am writing my own implementation of ToLower(char *str) in C. But i am getting segmentation fault in the function. The function which i wrote is :
void ToLower(
It's generally considered to be good form to accept a length parameter in functions that operate on strings. This way, if you pass in a string that's not null-terminated, the function won't loop past the end of the input.
You could step through the function call with a debugger, or add a print statement in the loop and see how many times it's iterating.