Is there any alternative for erasing a string character when using a loop and still manage to keep the last character? I'm trying to do this in a for loop in my extraction operator overloading. The addition work well but the last character in the string array is not displayed for example, 1256 + 1000 will return 225[?]. Not sure how to go about this
1 2 3 4
for (int i = s.size()-1 ; i >= 0; --i) {
n.digits[i] = s[0] - '0';
s.erase(0, 1);
}