Click here to Skip to main content
16,020,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionfiles displayed on the CFileDialog Pin
see me27-Jul-06 23:14
see me27-Jul-06 23:14 
Questionmem allocation in console app Pin
9ine27-Jul-06 23:00
9ine27-Jul-06 23:00 
AnswerRe: mem allocation in console app Pin
Jonathan [Darka]27-Jul-06 23:02
professionalJonathan [Darka]27-Jul-06 23:02 
AnswerRe: mem allocation in console app Pin
toxcct27-Jul-06 23:02
toxcct27-Jul-06 23:02 
GeneralRe: mem allocation in console app Pin
9ine27-Jul-06 23:25
9ine27-Jul-06 23:25 
GeneralRe: mem allocation in console app Pin
toxcct27-Jul-06 23:29
toxcct27-Jul-06 23:29 
GeneralRe: mem allocation in console app Pin
9ine28-Jul-06 0:57
9ine28-Jul-06 0:57 
GeneralRe: mem allocation in console app Pin
Zac Howland28-Jul-06 9:30
Zac Howland28-Jul-06 9:30 
9ine wrote:
Whats the point, writing additional mem free routines to get rid of allocated ones, as it will be deallocated after console is terminated. It is very well designed and quite large but without deallocation.


This makes no sense. Technically, heap memory will be reclaimed by the OS after the program terminates, but if you fail to free it yourself when you are done with it, then your program will slowly (or not so slowly) eat up more and more memory while it is executing (assuming you are allocating based on some set of events -- and if you are not, chances are that data would be better served on the stack anyway). As far as file handles (and pretty much any kernel object), they will NOT be reclaimed when your program exits. This means that if you open a file and then quit, you may need to restart your computer before you can reopen that file (NOT GOOD!).

The point is, if you allocate memory, you should free it. If you don't, do not submit that code as an assignment nor as production code for any company ... it will be rejected as incomplete.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: mem allocation in console app Pin
9ine1-Aug-06 6:24
9ine1-Aug-06 6:24 
GeneralRe: mem allocation in console app Pin
Gary R. Wheeler29-Jul-06 3:31
Gary R. Wheeler29-Jul-06 3:31 
QuestionVS6 Linker looking for Include files? Pin
Storm-blade27-Jul-06 22:49
professionalStorm-blade27-Jul-06 22:49 
AnswerRe: VS6 Linker looking for Include files? Pin
toxcct27-Jul-06 22:55
toxcct27-Jul-06 22:55 
GeneralRe: VS6 Linker looking for Include files? Pin
Storm-blade27-Jul-06 23:59
professionalStorm-blade27-Jul-06 23:59 
AnswerRe: VS6 Linker looking for Include files? Pin
Cedric Moonen27-Jul-06 22:58
Cedric Moonen27-Jul-06 22:58 
GeneralRe: VS6 Linker looking for Include files? Pin
Storm-blade27-Jul-06 23:58
professionalStorm-blade27-Jul-06 23:58 
GeneralRe: VS6 Linker looking for Include files? Pin
Cedric Moonen28-Jul-06 0:06
Cedric Moonen28-Jul-06 0:06 
AnswerRe: VS6 Linker looking for Include files? Pin
Hamid Taebi27-Jul-06 23:07
professionalHamid Taebi27-Jul-06 23:07 
AnswerRe: VS6 Linker looking for Include files? Pin
KarstenK27-Jul-06 23:13
mveKarstenK27-Jul-06 23:13 
GeneralRe: VS6 Linker looking for Include files? Pin
Storm-blade28-Jul-06 0:02
professionalStorm-blade28-Jul-06 0:02 
AnswerRe: files displayed on the CFileDialog Pin
Naveen27-Jul-06 22:52
Naveen27-Jul-06 22:52 
JokeRe: files displayed on the CFileDialog Pin
Hamid Taebi27-Jul-06 23:09
professionalHamid Taebi27-Jul-06 23:09 
GeneralRe: files displayed on the CFileDialog Pin
toxcct27-Jul-06 23:19
toxcct27-Jul-06 23:19 
GeneralRe: files displayed on the CFileDialog Pin
Hamid Taebi27-Jul-06 23:32
professionalHamid Taebi27-Jul-06 23:32 
GeneralRe: files displayed on the CFileDialog Pin
Naveen27-Jul-06 23:37
Naveen27-Jul-06 23:37 
GeneralRe: files displayed on the CFileDialog Pin
toxcct27-Jul-06 23:56
toxcct27-Jul-06 23:56 

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.