Okay so I am a really new to C++. I do have a java background, but with c++ I know I now have to do my own garbage collection.
Here is my scenario:
int main(){
float * pt;
while(true){
// some code
}
delete pt;
return 0;
Say you are in a endless while loop and then you decide to end your program by clicking on the close button on the window. What does closing the program do? Does it terminate the while loop, and then execute the delete command? Or does it simply terminate the program without completing the delete command.