Source code quote in C++n° 275
June 10, 2016 am30 01:30
static const int Num = 5;
class Recursive
{
public:
long long result;
Recursive(int WhatIveGot, int Count)
{
if ( !Count ) result = 1;
if ( 0 >= WhatIveGot ) return;
result *= WhatIveGot;
new (this)Recursive(WhatIveGot-1, Count+1);
}
} a(Num, 0);
std::wcout << L"Factorial(" << Num << L"): " << a.result << std::endl;