Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Display 100 Hello World Without Using Loops.
In C++, make the compiler do your recursion:
#include <iostream> template <int N> void pr(const std::string &msg) { std::cout << msg << std::endl; pr<N-1>(msg); } template <> void pr<0>(const std::string &msg) { } int main(int argc, char *argv[]) { pr<100>("Hello World"); return 0; }
There are no comments on this comment yet.
In C++, make the compiler do your recursion: