The code to compute the factorial is trivial so you can write it by yourself; the only problem could be the size of numbers you want to deal with.
If you use the native types provided by your compiler, you have this limits:
- an
unsigned int
(32 bit in size) can hold at most 12! - an
unsigned __int64
(64 bit in size) can hold at most 20!
If you want to handle the factorial of numbers bigger than 20, you should use a library for big-integers (like the ones used to handle the numbers involved in
RSA cipher, which are 1024 bit and more). See
http://www.google.it/#hl=it&source=hp&biw=1676&bih=877&q=bigint+c%2B%2B&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=65414bacc8cbde34[
^].