Comparing two vectors of arbitrary size, block by block
If at all possible, I'd start from a slightly different direction. I'd start by defining the group of 4 ints as a type:

static const int blocksize = 4;

class block {
    std::array&lt;int, blocksize&gt; data;

    bool operator&lt;(block const &amp;other) { 
        for (int i=0; i&lt;blocksize; i++)
            if (data[i] &lt; other.data[i])
                return true;
            if (other.data[i] &lt; data[i])
                return false;
        }
        return false;
    }
};


Having done that, you can use a standard algorithm to get the desired result:

std::vector&lt;block&gt; find_diff(std::vector&lt;block&gt; a, std::vector&lt;block&gt; b) {
    std::vector&lt;block&gt; difference; // where we'll put the result

    // set operations require sorted inputs   
    std::sort(a.begin(), a.end());
    std::sort(b.begin(), b.end());

    std::set_difference(a.begin(), a.end(), 
                        b.begin(), b.end(), 
                        std::back_inserter(difference));
    return difference;
}