I am trying to create an interface to an array in C++.  

In the code below   

`tmpClass[1].GetA()` returns 'w'  

`tmpInterface[1]` causes an error.  

Is there any way to define an interface so it can access the elements of the array?  

How to I get `tmpInterface` to behave like `tmpClass`?

```
struct IA
{
    virtual char GetA() = 0;
    virtual void SetA(char pA) = 0;
};

class A:public IA
{
    public:
        A(){ var = 0; }
        A(char pVar){ var = pVar; }
        char GetA(){ return var; }
        void SetA(char pA){ var = pA; }
    private:
    int var;
};

class B
{
    public:
        B(){ 
            mA[0].SetA('c');
            mA[1].SetA('w');
            mA[2].SetA('6');
            mA[3].SetA('$');
        }

        int GetCount(){}
        IA* Get1(){ return mA; }
        A* Get2(){ return mA; }
    protected:
        A mA[4];
};

int main()
{
    B mainClass;
    IA *tmpInterface = mainClass.Get1();
    A *tmpClass = mainClass.Get2();

    for (int i = 0; i < 4; i++)
    {
        //once i>0 then tmpInterface no longer points to a valid character
        //and program crashes
        System::Console::Write(
            "A = "+tmpClass[i].GetA()+
            " IA = "+tmpInterface[i].GetA()); 
    }
    return 0;
}

```