Thread: Please help... Avoiding run-time errors.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    Try this:
    Code:
    for(int i=3; i>0; i--;)
    {
    do
    	{
    		system("CLS");
    		cout<<"\n\n\t[[ Scissors, Paper, Stone 2002 ]] - [ Coded by mvb ]";
    		cout<<"\n\n\t[ N E W    G A M E ]";
    		cout<<"\n\n\tPOINTS DETAILS:";
    		cout<<"\n\n\tPoints for a win [ between 1 and 100 ]...";
    		cout<<"\n\n\t\t>> ";
    		cin>>pointwin;
    		if (cin.fail())
    		{
    		   cin.clear();
    		   cin.ignore();
                                       i++;
                                       //so it "reasks"
    		}
    	} while (pointwin < 1 || pointwin > 100 );
    }
    Last edited by Driveway; 08-31-2002 at 10:12 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Displaying Function Run Time
    By pf732k3 in forum C Programming
    Replies: 1
    Last Post: 03-21-2008, 12:36 PM
  2. need help in time zone
    By Gong in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2007, 04:44 AM
  3. file & linked list run time error
    By Micko in forum C Programming
    Replies: 9
    Last Post: 03-06-2004, 02:58 AM
  4. inputting time in separate compilation
    By sameintheend01 in forum C++ Programming
    Replies: 6
    Last Post: 03-13-2003, 04:33 AM
  5. Create class at run time
    By muaed in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-11-2002, 08:13 AM