Not exactly, but you can easily come up.
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef vector<string> CommandLineStringArgs;
int main(int argc, char *argv[])
{
CommandLineStringArgs cmdlineStringArgs(&argv[0], &argv[0 + argc]);
for (int i = 0; i < cmdlineStringArgs.size(); ++i)
{
cout << cmdlineStringArgs[i] << endl;
}
return 0;
}
It just uses an overloaded constructor for std :: vector, which takes an iterator initialization / end pair to copy command line arguments to vectors. This is the same as java from here.
You can also create and create objects around this vector using utility methods for converting arguments, but there is almost no point. There are also many packages with objects that deal with the interpretation of command line keys, etc. ACE, POCO, QT, etc. Everyone has such opportunities.