Created
March 23, 2013 14:17
-
-
Save mattmcd/5227865 to your computer and use it in GitHub Desktop.
C++11 program to print input arguments on separate lines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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