#includeint main(int argc, char* argv[]) { using namespace CPP_AL; ArgList args(argc, argv); const char* mask = args.GetMaskNext("--mask"); if (mask != NULL) { // Do something with the mask argument } return 0; }
#includeThis example shows another use case for the GetMaskNext function. It checks if there is a "-f" argument in the command-line arguments. If it is present, it returns a pointer to the argument following "-f". Otherwise, it returns NULL. Both examples use the CppArgList library.int main(int argc, char* argv[]) { using namespace CPP_AL; ArgList args(argc, argv); const char* filename = args.GetMaskNext("-f"); if (filename != NULL) { // Do something with the filename argument } return 0; }