The error is on line 76 int res[mSize]; the problem is on mSize. It seems like a simple fix but I can't figure it out. If someone can figure it out or point me in the right direction that would be greatly appreciated.
Also, the deconstructor ~MyContainer(), I am not sure if I am using it right or if there is a correct place to put it.
Here is my code:
#include <iostream>
using namespace std;
class MyContainer
{
private:
    int* mHead; // head of the member array
    int mSize;  // size of the member array
public:
    MyContainer();
    MyContainer(int*, int);
    //~MyContainer();
    void Add(int);
    void Delete(int);
    int GetSize();
    void DisplayAll();
    int FindMissing();
    ~MyContainer() {}
};
MyContainer::MyContainer()
{
    mHead = NULL;
    mSize = 0;
}
MyContainer::MyContainer(int* a, int b)
{
    mHead = a;
    mSize = b;
}
void MyContainer::Add(int a)
{
    *(mHead + mSize) = a;
    mSize++;
}
void MyContainer::Delete(int a)
{
    int index;
    for (int i = 0; i < mSize; i++)
    {
        if (*(mHead + i) == a)
        {
            index = i;
            break;
        }
    }
    for (int i = index; i < mSize; i++)
    {
        *(mHead + i) = *(mHead + i + 1);
    }
    mSize--;
}
int MyContainer::GetSize()
{
    return mSize;
}
void MyContainer::DisplayAll()
{
    cout << "\n";
    for (int i = 0; i < mSize; i++)
    {
        cout << *(mHead + i) << " ";
    }
}
int MyContainer::FindMissing()
{
    int res[mSize];
    int temp;
    int flag = 0;
    for (int i = 1; i <= mSize; i++)
    {
        flag = 0;
        for (int j = 0; j < mSize; j++)
        {
            if (*(mHead + j) == i)
            {
                flag = 1;
                break;
            }
        }
        if (flag == 0)
        {
            temp = i;
            break;
        }
    }
    return temp;
}
int main() 
{
    const int cSize = 5; 
    int lArray[cSize] = { 2, 3, 7, 6, 8 }; 
    MyContainer lContainer(lArray, cSize); 
    lContainer.DisplayAll(); 
    lContainer.Delete(7); 
    lContainer.DisplayAll(); 
    cout << "Size now is: " << lContainer.GetSize() << endl; lContainer.Add(-1); 
    lContainer.Add(-10); 
    lContainer.Add(15); 
    lContainer.DisplayAll(); 
    cout << "Size now is: " << lContainer.GetSize() << endl; 
    cout << "First missing positive is: " << lContainer.FindMissing() << endl;
    system("PAUSE"); return 0;
}
 
     
    