I'm currently doing Project Euler Challenge 8 where you have to find the largest product of a series of 5 digits in a 100 digit number.
The code is obviously very basic, but I have a problem getting C++ to read in the very huge integer since long_int is not big enough to store it.
Now I could obviously type in every single digit by itself and it would run but there has to be a more elegant way to do this!
Despite doing some web research (Do I have to write a class?) I have not found a satisfactory answer for my problem.
That way, it's easier to pluck digits out of it (you don't have to resort to division/modulus), and you also don't have to use an arbitrary-precision library (or write your own).
for (unsigned i = 0; i + 5 < my100DigitNum.size(); ++i)
{
// Now work with my100DigitNum[i], my100DigitNum[i+1], ... , my100DigitNum[i+4] here
// Note that you'll have to convert them from their character form to ints
// Subtracting '0' from the character should work for most people
}