>>
The program should have crashed in the visual studio C++ compiler version as well, but it did not.
The correct statement is "The behavior of the program is undefined."
i.e.
a) it is not required to crash
b) it is not required to to be benign
c) it
may trash something in your program that will not appear in testing
d) it
may trash something in your program that will only appear at user site
I would suggest you perform a Find in Files for all occurences of "delete*[]"
Then for each, in seperate find window, locate all allocates to that pointer to check consistancy of use.
Then invert and find all allocates using [ and then for each check the delete.
PCLINT might be able to detect this (I don't use it, but I think it will detect this)
Using a container for the arrays can be helpful in eliminating this problem. If programmed correctly it will not add any computational overhead to the program (if may potentially for some vector optimizations).
Jim Dempsey