Hi,
I have some questions about operator new and delete .


class record
{
public:
record(int,string);
record();
~record();
int number;
string name;
function...

};

//constructor
record::record(int m ,string n)
{
number=m;
n=name;
if (......) //some condition is checked
{exit1(); //if condition is true terminate the program }
}

//deconstructor
record::~record() { }


main()
{
p=new record (1,"Papoo");
delete p;
}

The questions I have in mind are:
1) If I am trying to create an object p of type record dynamically by using new and in the constructor there is some condition to be checked and let's assume if that condition is true the program terminates.
Since the program is terminated is the new object p being created?Based on the fact that the condition is true, following questions arise.
2) If the object p is being created using new, is it being deleted from the memory?
3) Since the (delete p ) is in main() and its not even being called from the main(), is the memory free or there are going to be memory leaks associated?

The program that I have may not have meaning, but actually I have some other program which is much complicated and I cannot put it on board, so I am just trying to clear some of my doubts through this program.

Thanks,
papoo.