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.)

Okay, great!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.