How to store extremely large numbers?
You'll have to use a bigint or bignum implementation. There are some libraries out there like this: http://gmplib.org/
Some more info and a list of libraries: http://en.wikipedia.org/wiki/Bignum
If you already have a boost dependency (which many people these days do), you can use the boost multi-precision library. In fact, it already has an example of a factorial program that can support output up to 128 bits, though extending it further is pretty trivial.