Click here to Skip to main content
16,005,491 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: playing and audio "wav" file Pin
Alvaro Mendez31-Mar-03 5:23
Alvaro Mendez31-Mar-03 5:23 
GeneralRe: playing and audio "wav" file Pin
Brigsoft31-Mar-03 7:21
Brigsoft31-Mar-03 7:21 
GeneralCleaning my memory wenn shutting down programm Pin
Willem B31-Mar-03 2:48
Willem B31-Mar-03 2:48 
GeneralRe: Cleaning my memory wenn shutting down programm Pin
Chris Losinger31-Mar-03 3:02
professionalChris Losinger31-Mar-03 3:02 
GeneralRe: Cleaning my memory wenn shutting down programm Pin
Willem B31-Mar-03 3:17
Willem B31-Mar-03 3:17 
GeneralRe: Cleaning my memory wenn shutting down programm Pin
Chris Losinger31-Mar-03 3:33
professionalChris Losinger31-Mar-03 3:33 
GeneralRe: Cleaning my memory wenn shutting down programm Pin
Anonymous31-Mar-03 3:48
Anonymous31-Mar-03 3:48 
GeneralRe: Cleaning my memory wenn shutting down programm Pin
Alvaro Mendez31-Mar-03 5:34
Alvaro Mendez31-Mar-03 5:34 
Anything allocated with new or malloc is not "deleted" by the compiler. It needs to be cleaned up with "delete", "free", or you can just let it happen when the program exits. However, if the program runs for a while, more and more memory may continue to be allocated and eventually you'll run out of it, causing the program to crash.

The only memory the compiler cleans up automatically is the stack, which you can use to efficiently allocate any variable:

{
  CString s = "allocated on the stack so it will be free automatically";
  CString* p = new CString("allocated on the heap, needs to be freed with delete");
 
  delete p;  // p must be cleaned up explicitly
}  // s is automatically cleaned up here

Regards,
Alvaro




When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
GeneralMake colord darker/grayer Pin
Brian van der Beek31-Mar-03 2:12
Brian van der Beek31-Mar-03 2:12 
GeneralRe: Make colord darker/grayer Pin
Jason Henderson31-Mar-03 3:42
Jason Henderson31-Mar-03 3:42 
GeneralRe: Make colord darker/grayer Pin
Brian van der Beek31-Mar-03 3:48
Brian van der Beek31-Mar-03 3:48 
GeneralRe: Make colord darker/grayer Pin
Jason Henderson31-Mar-03 4:23
Jason Henderson31-Mar-03 4:23 
GeneralRe: Make colord darker/grayer Pin
Brian van der Beek31-Mar-03 4:40
Brian van der Beek31-Mar-03 4:40 
GeneralRe: Make colord darker/grayer Pin
Maximilien31-Mar-03 4:16
Maximilien31-Mar-03 4:16 
GeneralAutomatic macro increment Pin
Jesper Knudsen31-Mar-03 2:05
Jesper Knudsen31-Mar-03 2:05 
GeneralRe: Automatic macro increment Pin
Cedric Moonen31-Mar-03 2:25
Cedric Moonen31-Mar-03 2:25 
GeneralRe: Automatic macro increment Pin
Jesper Knudsen31-Mar-03 2:40
Jesper Knudsen31-Mar-03 2:40 
GeneralRe: Automatic macro increment Pin
Daniel Turini31-Mar-03 7:54
Daniel Turini31-Mar-03 7:54 
GeneralRe: Automatic macro increment Pin
Alvaro Mendez31-Mar-03 5:44
Alvaro Mendez31-Mar-03 5:44 
Generalstatic control color Pin
Cedric Moonen31-Mar-03 1:20
Cedric Moonen31-Mar-03 1:20 
GeneralRe: static control color Pin
Alin Negru31-Mar-03 1:31
Alin Negru31-Mar-03 1:31 
GeneralRe: static control color Pin
Cedric Moonen31-Mar-03 2:18
Cedric Moonen31-Mar-03 2:18 
GeneralRe: static control color Pin
Gunnar Bolle31-Mar-03 2:40
Gunnar Bolle31-Mar-03 2:40 
GeneralRe: static control color Pin
Cedric Moonen31-Mar-03 2:54
Cedric Moonen31-Mar-03 2:54 
GeneralHelp about appending the latest data to another file. Pin
dxhdxh31-Mar-03 1:09
dxhdxh31-Mar-03 1:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.