ok i want to make a function and use a pointer and make it in free store part of the memory like this:

#include <iostream.h>

void hi();

int main ()

{
cout<<"hi"<<endl;
hi();
cout<<pAge<<endl;

/* it doesnt remember pAge when it should be in the free store part of memory which means it should stay in memory right ? */

}

void hi()

{
int * pAge = new short int;
*pAge = 6;

}

why is pAge deleted from memory when i put it in free store where it shouldnt be deleted ?