From: eyal DOT ben-david AT aks DOT com To: dv1b AT hotmail DOT com cc: djgpp AT delorie DOT com Message-ID: Date: Wed, 21 May 1997 18:04:36 +0300 Subject: Re: SUBJECT:(HELP ME)My Computer is Stupied or I am Stupied ??? (Too mush lines? its source code!) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Precedence: bulk Hello. 1. put the line: "cin.ignore(1024, '\n');" before any cin.getline(). Also, replace every "fflush(stdin)" with the above statement. 2. At the line of the problem (with getline), you read a string and then parse it to find a number (by atoi). Why don't you use operator >> ? cin.ignore(1024, '\n'); if ( !(cin >> number) ) { cerr << "failed to read number" << endl; HandleError(); } In this approach you don't need to test isitNumber. it is done for you by cin 3. Why don't you use ofstream and ifstream for file I/O ?. The mix between stdio and iostream looks unnatural. The syntax of ofstream and ifstram is simple, and identical to cin/cout. 4. Good Luck eyal.