I have two strings. For example, "1234567891011" and "11223232323232". I want to add them, so that i get the correct result(mathematically).
I can't concatenate the strings.
I have tried converting them to int and then adding. But that only works for small strings, as int has an upper bound.
I want my program to work for any std::string object. No matter how long.
As i am just thinking of the way, there is no useful code to post. Thanks for your help.
The fact is that all the basic types have limits and the only way is to implement "unlimited int". Luckily, that wheel has been invented multiple times and the question becomes: Which BigInt library to use? The current C++ standard has taken some bits from Boost, so Boost can potentially have a decent package for this too.