c++ function inside main
auto fac = [] (unsigned int val) { return val*42; }; // With the rise of C++11 a while back, you can now have local functions whose syntax is // a little reminiscient of JavaScript:
Source: stackoverflow.com