#include #include #include /* int getopt(int argc, char *const argv[], const char *optstring); */ using namespace std; extern char *optarg; extern int optind, opterr, optopt; int main(int argc, char * argv[]) { int res; while ( (res = getopt(argc, argv, "aeiou")) != -1 ) { cout << "The result is " << static_cast(res) << endl; cout << "The next position is " << optind << endl; cout << endl << endl; } return 0; }