I have written a small console application with this structure:
If I close the application, will the memory be deallocated? More precisely: will my code that deals with deallocating the memory be executed, or will the OS (WindowsXP) handle this for me? What is the 'correct' way to deal with a this (a loop that should run untill the application is closed)?Code:int main()
{
AllocateSomeMemory();
while(1)
{
Sleep(30);
DoSomeThings();
}
DeallocateSomeMemory();
}