Given a number represented as an array of digits, plus one to the number Given a number represented as an array of digits, plus one to the
  number.

input                    expected 

[8,9,9,9]                [9,0,0,0]    

[1,0,0,0,0]              [1,0,0,0,1]  

[9,8,7,6,5,4,3,2,1,0]    [9,8,7,6,5,4,3,2,1,1]    



The following is my C++ code:

vector&lt;int&gt; plusOne(vector&lt;int&gt; &amp;digits)
{
    vector&lt;int&gt; result;
    vector&lt;int&gt;::iterator it;
    int plus = 1; 
    for (it = digits.end() - 1; it &gt;= digits.begin(); --it)
    {
        int sum = *it + plus;
        if (sum &gt; 9)
        {
            plus = 1;
            result.push_back(0);
        }
        else
        {
            result.push_back(sum);
            plus = 0;
        }
    }

    if (plus==1)
    {
        result.push_back(1);
    }

    reverse(result.begin(), result.end());
    return result;  
}
Since you are returning a result.
Pass the parameter by const reference so that you don't accidentally modify it:

vector&lt;int&gt; plusOne(vector&lt;int&gt; const&amp;  digits)


The less than operator is not defined for iterators.
You are just getting lucky.

for (it = digits.end() - 1; it &gt;= digits.begin(); --it)


To iterate over a container in the reverse direction use rbegin() and rend()

for (it = digits.rbegin(); it != digits.rend(); ++it)


To help with efficiency you could reserve space in your result:

result.reserve(digits.size()+1); // The +1 is for cases where the result overflows.
                                 // Note: reserve() does not change the size of the
                                 //       vector just the underlying capacity.


Personally I would have refactored:

    if (sum &gt; 9)
    {
        plus = 1;
        result.push_back(0);
    }
    else
    {
        result.push_back(sum);
        plus = 0;
    }


the body into:

    plus = (sum == 10) ? 1 : 0
    sum  = (sum == 10) ? 0 : sum;

    result.push_back(sum);