Math-Linux.com

Knowledge base dedicated to Linux and applied mathematics.

Home > C++ > FAQ C++ > FAQ C++ - STL > How to get command-line parameters in a C++ vector<string> ?

How to get command-line parameters in a C++ vector<string> ?


using namespace std;
int main(int argc, char* argv[])
{
    vector<string> parameters(argv, argv+argc);
    ...
}

Also in this section

  1. How to print the elements of a C++ std::vector with GNU Debugger GDB ?
  2. How to convert string to lower case or UPPER case in C++ ?
  3. How to get command-line parameters in a C++ vector<string> ?
  4. How to split a string in C++ using STL ?
  5. How to sum elements of a C++ std::vector ?