Dyanamic Array Class, Program runs well but with Error
<p>This is my Code</p>

<pre><code>#ifndef INTLIST_H_INCLUDED
#define INTLIST_H_INCLUDED
#include &lt;iostream&gt;
using namespace std;

class intList
{
    int upper_bound;
    int arr[0];
    public:
        intList(){ arr[0] = 0; upper_bound = 0; }
        void append(int x);
        void sort();
        friend ostream &amp; operator &lt;&lt; (ostream &amp;, intList&amp;);
        inline int len(){ return upper_bound; }
        inline int &amp;operator [](int x){ return arr[x]; }
    private:
        void increment(int *a, int &amp;l);
        void swap(int &amp;a, int &amp;b);
};

void intList::swap(int &amp;a, int &amp;b)
{
    int temp = a;
    a = b;
    b = temp;
}

void intList::increment(int *a, int &amp;b)
{
    b++;
    a[b] = 0;
}

void intList::append(int num)
{
    arr[upper_bound] = num;
    increment(arr, upper_bound);
}

void intList::sort()
{
    for(int i = 0; i &lt; upper_bound; i++)
    {
        int minLoc = i;
        for(int j = i+1; j&lt;upper_bound; j++)
        {
            if(arr[j] &lt; arr[minLoc])
                minLoc = j;
        }
        if(minLoc != i)
            swap(arr[i], arr[minLoc]);
    }
}

ostream&amp; operator &lt;&lt; (ostream &amp; dout, intList &amp;a)
{
    dout &lt;&lt; "[ ";
    for(int i = 0; i&lt;a.upper_bound-1; i++)
        dout &lt;&lt; a.arr[i] &lt;&lt; ", ";
    dout &lt;&lt; a.arr[a.upper_bound-1] &lt;&lt; " ]";

    return dout;
}

#endif // INTLIST_H_INCLUDED
</code></pre>

<p>The Code does its work perfectly fine. But at the end the Program Crashes. Giving some error like 
process returned -1073741819 (0xC0000005) execution time : some seconds.</p>

<p>Just didn't get where am I going wrong.</p>
