C++ conversion of this C snippet for a simple interactive menuing system.
The code shows three files:
- menu.h: The header file for the menu class.
- menu.cpp: Implementation of the menu class.
- main.cpp: A sample driver that uses the library.
The menu library is fairly generic in that you can provide a format string of menu options and possible matching input values. See main.cpp for an example of how to use it. Note that C++11 features are used in this code.