C++ Gurus...

Started by
19 comments, last by klubbkid 23 years, 6 months ago
I had to scroll all the way to the bottom of this page before someone pointed that out, dynamic arrays will bomb, They compile but,
long *SomeArraryPtr = new ElementSize[nVariable];
sizeof(SomeArrayPtr)/sizeof(ElementSize)
reports 0

unless SomeArray is defined with a constant number of elements.
i.e. long SomeArray[20];
then it will work.I''m not sure for
long *SomeArrary = new _somestruct[20];

Why not just use an int, or perhaps this assembler code for the delete function, make statement like
delete [] somearray;
and debug in asm. It finds the number of bytes or whatever to delete, I used visual c++ 6.0 and got the asembler code. To long to post here, but e-mail me JesterSI@metacrawler.com



- Keep it simple stupid

This topic is closed to new replies.

Advertisement