> gets(&input); Change this to an fgets, please. > if (input[0] == EOF) This can never happen. Check return value of fgets instead. Arne