Cud somebody tell me wat is happening???
I am checking if I can use Sun WorkShop Memory Monitor as a substitute for
Rational purify
but this simple leak is not detected.
#include <iostream.h>
int main()
{
int *name ;
name = new int[10]; <-------this is not
detected as leak
cout<< "name is "<<name[0] <<endl;
delete [] name;
return 0;
On the other hand if i allocate memory in a loop like this it is detectedQuote:}
as a leak
#include <iostream.h>
int main()
{
int *name ;
/for (int i=0; i<3 ; i++)
name = new int[10]; <-------this is
detected as leak
cout<< "name is "<<name[0] <<endl;
delete [] name;
return 0;
Is it safe to go ahead and use Sun WorkShop Memory Monitor instead ofQuote:}
purify?