Skip to content

Instantly share code, notes, and snippets.

@mattmcd
Created March 23, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmcd/5227865 to your computer and use it in GitHub Desktop.
Save mattmcd/5227865 to your computer and use it in GitHub Desktop.
C++11 program to print input arguments on separate lines.
#include <iostream>
#include <vector>
#include <string>
int main(int argc, char* argv[])
{
std::vector<std::string> args(argc);
args.assign( argv, argv+argc);
for( const auto arg : args ) std::cout << arg << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment