Adding arbitrarily long integers C++ (string represented)
Prepending zeros one at a time is quite inefficient.  It could be improved by making a string of the appropriate length in one go:

{
    auto l1 = n1.length();
    auto l2 = n2.length();
    if (l1 &lt; l2)
        n1 = std::string{"0", l2-l1} + n1;
    else if (l1 &gt; l2)
        n2 = std::string{"0",  l1-l2} + n2;
}


Reassembling the string afterwards character by character is also inefficient.  This can be improved by telling the string how long it will need to be:

std::string o = "";
o.reserve(sums.size());


The index variables i should be an unsigned type to compare against string length or vector size - I recommend using the same type as those methods return.

Greater gains can be made by keeping the long integer as a chain of digits without adding '0' to make them printable characters at each stage; it also helps to store them in little-endian order (so that any carry gets appended rather than prepended).  See Digit-by-digit addition using vectors for a start.  You could reduce storage requirements by using base-100 instead of base-10 (char is guaranteed to hold ranging at least from 0 to 127).