Re: Explicitly calling the constructor

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Antii,

CTestClass* pData = (CTestClass*) malloc( sizeof(CTestClass) );

What is wrong with:

CTestClass *pData = new CTestClass;

?????
And if you are in doubt about enough memory for
your class you can always try/catch.

Regards
Roland
.