Skip to content

Instantly share code, notes, and snippets.

@Dubhead
Created September 20, 2011 07:09
Show Gist options
  • Save Dubhead/1228543 to your computer and use it in GitHub Desktop.
Save Dubhead/1228543 to your computer and use it in GitHub Desktop.
echo in C++11
// 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