Created
September 20, 2011 07:09
-
-
Save Dubhead/1228543 to your computer and use it in GitHub Desktop.
echo in C++11
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
// echo in C++11 | |
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
int main(int argc, char* argv[]) | |
{ | |
std::vector<std::string> strings(argv + 1, argv + argc); | |
std::for_each(begin(strings), end(strings), [](const std::string& s) { | |
std::cout << s << std::endl; | |
}); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment