#include "NormalClass.h" class FView : public CView { DECLARE_DYNCREATE (FView) public: FView (); ~FView (); NormalClass *m_pcNormal; }
FView::FView () { m_pcNormal = new NormalClass[20]; }
FView::~FView () { if (m_pcNormal) { for (int i = 0; i < 20; i++) { delete m_pcNormal[i]; // problem is here // it is showing expression must have pointer or handle // it is crashing when i am doing like this delete &m_pcNormal[i]; } delete [] m_pcNormal; m_pcNormal = NULL; } }
class NormalClass { private: funt1 (); int a; public: NormalClass(); ~NormalClass(); }
delete
new
m_pcNormal
NormalClass**
m_pcNormal[]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)