c cannot convert from type A* to type B*
<p>I need to change DMapEntry::pData from a char* to a class DMapData that contains the original pointer but still be able to refer to &amp;pData[offset] in DMapEntry without changing it. Is this possible? </p>

<pre><code>#include "stdafx.h"

class DMapData {
    char* pData;
public:
    char* operator-&gt;() { return pData; }
    char operator[](size_t offset) { return pData[offset]; }
    friend class DMapEntry;
};

class DMapEntry {
    char* pStr;
public:
    DMapData pData;
/*-----&gt;*/    void getStr(size_t offset) { pStr = &amp;pData[offset]; }
};

int _tmain(int argc, _TCHAR* argv[])
{
    DMapEntry a;
    return 0;
}
</code></pre>

<p>Thanks,
Carl</p>
