I'm writing a program that accepts command line arguments and prints them out in alphanumerically sorted order with a custom comparator.
Along the way I got stuck with inserting the command-line arguments in the std::set
container. Reviewed some similar code online and found something like:
std::set<char*, decltype(customComparator)> args (argv, argv+argc, customComparator)
What does the argv + argc
argument mean/do?
When I tried inserting the cmd argument like:
std::set<char*, decltype(customComparator)> args (argv, customComparator)
There's a red squiggly line on the argv
argument.