C: When a user does not provide an input I'm getting "Segmentation fault: 11". It works fine when a user does provide an input. How can I fix this? : Its a while (1) loop continuously asks user for input until terminated.
I want it to ask the user for an input and if no input is given upon pressing enter it should ask for the input again.
I've initialized input as char input[100]; I also tried doing "char *input = (char *)malloc(10*sizeof(char));" but it does not help.

