IntArray implementation
Main changes:


Assuming you keep an int length, check for size &gt;= 0 in constructor IntArray(int size = 0);, and in void IntArray::insertBefore(int d, int index)
You thought about delete[] data in the destructor. However, there are other places in your code where data needs to be deleted: each time you change data's value, you need to deallocate what used to be pointed by data. Ie, delete[] data before any data =


You added data = new int[length]; in the copy constructor, so you've solved the out of bound issue, but introduced a memory leak instead. You need to deallocate data first.
Same for the assignment constructor.
resize had an out-of-bound issue you've fixed 



Code used to be: 

void IntArray::resize(unsigned int size){
    for(int i=length; i&lt;size; i++){
        data[i] = 0;
    }
    length = size;
}


(Note: you're not supposed to edit your code, or put your updated code in a separate section, at the bottom of your question)



Opinion-based


Maybe use an unsigned type (like std::size_t) instead of the signed int for the length.


Pros:


You enforce the invariant "the length can only be positive"


Cons:


Special values (like -1 for "Index not found") will look like regular values, higher risk of underflow.
(see Herb Sutter comment at 44:30)




Other


Superfluous this-&gt; in operator[](int index)
Style: pick one of length or getSize()to get the data length, but don't mix the two (Here length is fine, in classes where you'd like to make a check before accessing the value, getSomething() is better.
Add a const version of operator[](int index)
Don't add an extra space at the end of operator&lt;&lt; (which you removed by mistake)




Going further

It depends on the assignment.


Optimization: Introducing capacity to reduce the number of allocations/deallocations
Add iterators
Add convenience methods (bool empty() const;, int&amp; front();)
Add typedefs like typedef int value_type (useful for for metaprogramming)
Add relationship operators (at least == and !=)




@glampert made excellent points I forgot, check his answer.