Skip to content

Instantly share code, notes, and snippets.

@kjk
Created May 31, 2020 06:56
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 kjk/93075d85b13e1cc6b4618d7f64f7a4f8 to your computer and use it in GitHub Desktop.
Save kjk/93075d85b13e1cc6b4618d7f64f7a4f8 to your computer and use it in GitHub Desktop.
#include <iostream>
constexpr long long factorial(long long n)
{
return (n == 0) ? 1 : n * factorial(n - 1);
}
int main()
{
char test[factorial(3)];
std::cout << factorial(7) << '\n';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment