delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/21/18:09:39

X-WM-Posted-At: MailAndNews.com; Tue, 21 Aug 01 18:08:33 -0400
X-WebMail-UserID: Ramiman12
Date: Tue, 21 Aug 2001 18:08:33 -0400
Sender: Ramy Elmeligy <Ramiman12 AT MailAndNews DOT com>
From: Ramy Elmeligy <Ramiman12 AT MailAndNews DOT com>
To: djgpp AT delorie DOT com
X-EXP32-SerialNo: 50000000
Subject: BREAK statement aint workin
Message-ID: <3B8B44A3@MailAndNews.com>
Mime-Version: 1.0
X-Mailer: InterChange (Hydra) SMTP v3.61.08
Reply-To: djgpp AT delorie DOT com

Here's a code snippet, taken from Ivor Horton's Beginning C++. It involves 
BREAKing a loop, after a certain number of invalid values are input. 
After i have compiled, when i try to run the program, i get a message saying 
BREAK is off and then it goes back to the DOS prompt. Whats the problem??

other code

//make sure table size is within limits
if(table >= table_min && table <= table_max)
  break;                                     //exit the input loop
else if(count < input_tries)
  cout << "Invalid input - Try again.";
else
{
 cout << "Invalid table size entered - for the third time."
      << "\nSorry, only three tries - program terminated."
      << endl;
 exit(1);
}

other code

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019