In the following loop I use a menu to select a choice from 1 to 6; 1 to 5 work as expected, ie call their appropriate functions and then go back to the menu, but when I enter 6 to end the probram I expect it to drop through to the next instructions after the while loop but the program just hangs. The menu is returning 'choice' as 6.
Sorry it is not so much hanging as just ging back to the menu display called with 'int choice=menu()'
Code:
while (choice >6 || choice<6)
{
system ("CLS");
int choice=menu();
switch (choice)
{
case 1 : opennewfile (); break;
case 2 : addrecord (); break;
case 3 : deleterecord (); break;
case 4 : readrecord (); break;
case 5 : readwholefile (); break;
}
choice=0;
}
instructions to printout thanks and goodbye
Sorry everybody I have figured it, it is the last choice=0; that is causing the problem, when I take that out it works.
Many apologies for wasting your time.