200+ digit input/output in C/C++

August 19, 2010 at 10:05:42
Specs: Windows XP(sp3)
hoe to read and perform arithmetic operations on a 200+ digit input in c/c++.?

See More: 200+ digit input/output in C/C++

Report •

August 19, 2010 at 10:42:23
Use a library that has arbitrary precision support.

Report •

August 20, 2010 at 09:50:46
200 digits is far beyond what the hardware on any affordable computer is going to natively handle. You have to emulate the basic arithmetic functions on either character strings (doing math column-by-column like you learned in grade school) or with arrays of 32 or 64 bit integers. Character-based is very slow, but easy to program, and it works directly on character strings that you can read in and print out with ordinary C/C++ I/O. Integer-based is quite a bit faster, but can be tricky to do right and to do I/O for (and will get you a higher grade from your prof).

Report •
Related Solutions

Ask Question