Hi good day to all,
I am suppose to write a program using class that allows me to add or subtract numbers that are very long. Eg 100 digits.
I have come out with a few ideas to go about doing it but need to clarify some points before i go about implementing it.
First and foremost,
I intend to store the long number as strings and add them up together using the ASICS code. Is this the best way to go about doing it ? Is there some other better ways.
As for adding up each character in the string using ASICS code, do i have to use a for loop and go through each chracter and adding them up? I know the "+" symbol is for adding on to the string and not real numerical addition.
Secondly,
As the two long strings of numbers that are entered may not be the same in length. I intend to do a sizeof and compare the length of both strings. If either one of the string is shorter, i will add 0s in front of it. Which string function should i use ? push back or insert ? How does both work ?
Thank you all for the help :)