Problem solved:

Thanks :) the program is now working ....
and i also gained some experience with the read() method :P i mean seriously i never thought that sometimes the input would depend on the os

(It was an issue of trying to process the newline characters.)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.