Im having a problem with the below code:
In that code menu_choice (int) is always the same value as is set in the first time of the loop, as if the DisplayMenu() method is never called after the 1st iteration.
AddressBook addr = new AddressBook();
menu_choice = addr.DisplayMenu();
} while (cont_menu != false);
However if i place AddressBook addr = new AddressBook(); inside the loop it works and displays the menu and sets the correct value of menu_choice.
This to me didnt seem the correct way of doing it though, Becase surly creating a new object/instance to a class for every iteration of the loop is inefficent?
Please can someone explain how this should be done.