Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Last active August 29, 2015 14:20
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 thiagomg/e35fcf381d9a8f55b4b0 to your computer and use it in GitHub Desktop.
Save thiagomg/e35fcf381d9a8f55b4b0 to your computer and use it in GitHub Desktop.
Hello World
#include <string>
#include <array>
#include <algorithm>
#include <iostream>
int main(int argc, char *argv[]) {
/*
* I don’t want to make the choice between elegant,
* which Simula was for this problem,
* and efficient, which BCPL was. I want both
* (Bjarne Stroustrup, 2015-02-05)
*/
std::array<std::string, 2> authors { "Fabio", "Thiago" };
std::for_each(std::begin(authors), std::end(authors),
[](const std::string &author) {
std::cout << "Hello from " << author << " !\n" ;
});
for(const auto &author : authors) {
std::cout << author << " hopes you like the site !\n" ;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment