/** * Asks "the user" for a menu option and then dispatches out to a handler that * will respond to their input. */ void main() { int user_choice = false, data_position = 0; float data_array[200]; size_t array_size = sizeof data_array / sizeof data_array[0]; do { display_menu(); user_choice = get_user_choice(); if (user_choice < 3 && user_choice > 0) data_position = process_user_choice(user_choice, data_array, array_size, data_position); else if (user_choice > 3 || user_choice < 0) printf("%d is not a valid menu option.\n", user_choice); } while (user_choice != 3); printf("Program terminated.\n"); }
bool mp_debug_checkup::local_checkup(const config& expected_data, config& real_data) { assert(real_data.empty()); real_data = get_user_choice("mp_checkup", checkup_choice(expected_data)); return real_data == expected_data; }