Line #17. Change


line != '\0';

line will never equal '\0', since it's just the name of the array, and has a constant address. Did you forget something?