Click here to Skip to main content
15,906,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Thank you, kindly, Harlod, Stuart, Sarath - your answers are greatly appreciated! Pin
«_Superman_»7-Jul-09 3:44
professional«_Superman_»7-Jul-09 3:44 
GeneralRe: Thank you, kindly, Harlod, Stuart, Sarath - your answers are greatly appreciated! Pin
harold aptroot7-Jul-09 15:27
harold aptroot7-Jul-09 15:27 
AnswerRe: Speaking of missing the basics - is there a way to dynamically size an array on the stack ? Pin
Single Step Debugger7-Jul-09 4:20
Single Step Debugger7-Jul-09 4:20 
AnswerRe: Speaking of missing the basics - is there a way to dynamically size an array on the stack ? Pin
molesworth7-Jul-09 4:29
molesworth7-Jul-09 4:29 
QuestionActually, no, I'm not sure I want to allocate large chunks of data on the stack... Here's what I'm doing at the moment... Pin
Mike the Red7-Jul-09 5:28
Mike the Red7-Jul-09 5:28 
AnswerRe: Actually, no, I'm not sure I want to allocate large chunks of data on the stack... Here's what I'm doing at the moment... Pin
Kevin McFarlane7-Jul-09 6:21
Kevin McFarlane7-Jul-09 6:21 
AnswerRe: Actually, no, I'm not sure I want to allocate large chunks of data on the stack... Here's what I'm doing at the moment... Pin
Rajesh R Subramanian7-Jul-09 7:23
professionalRajesh R Subramanian7-Jul-09 7:23 
AnswerRe: Actually, no, I'm not sure I want to allocate large chunks of data on the stack... Here's what I'm doing at the moment... Pin
Stuart Dootson7-Jul-09 8:36
professionalStuart Dootson7-Jul-09 8:36 
Mike the Red wrote:
using the heap should be avoided, as much as is reasonable


I think > than around 10kB of allocation probably crosses the boundary of reasonable and unreasonable avoidance of heap usage Smile | :)

Mike the Red wrote:
Tracking down those ommitted deletes is a pain, especially for often-changed member variables where I tend to forget to delete the existing object/value before creating the new one


If you're using VC2008, then std::tr1::shared_ptr[^] is handy.

If not (or even if you are - see shared_array), then Boost.SmartPointers[^] is handy.

The best advice is to wrap resource allocation/deallocation in an object[^] (allocation in constructors, deallocation in the destructor), so you can tie the resource usage to the object's lifetime. That's how the STL containers (vector, list, map, set etc) work.

C++ (when written in a nice idiomatic way) relies on deterministic destruction to manage resources - when done right, it makes programming as easy as using garbage collection, IMO.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionHow to Insert Data In Excel Pin
Anubhava Dimri7-Jul-09 2:45
Anubhava Dimri7-Jul-09 2:45 
AnswerRe: How to Insert Data In Excel Pin
Michael Schubert7-Jul-09 3:01
Michael Schubert7-Jul-09 3:01 
GeneralRe: How to Insert Data In Excel Pin
Anubhava Dimri7-Jul-09 18:15
Anubhava Dimri7-Jul-09 18:15 
GeneralRe: How to Insert Data In Excel Pin
David Crow8-Jul-09 3:02
David Crow8-Jul-09 3:02 
GeneralRe: How to Insert Data In Excel Pin
Anubhava Dimri8-Jul-09 18:08
Anubhava Dimri8-Jul-09 18:08 
QuestionRe: How to Insert Data In Excel Pin
David Crow9-Jul-09 1:46
David Crow9-Jul-09 1:46 
AnswerRe: How to Insert Data In Excel Pin
Anubhava Dimri9-Jul-09 2:31
Anubhava Dimri9-Jul-09 2:31 
QuestionRe: How to Insert Data In Excel Pin
David Crow9-Jul-09 2:37
David Crow9-Jul-09 2:37 
AnswerRe: How to Insert Data In Excel Pin
Anubhava Dimri9-Jul-09 18:04
Anubhava Dimri9-Jul-09 18:04 
GeneralRe: How to Insert Data In Excel Pin
David Crow10-Jul-09 3:04
David Crow10-Jul-09 3:04 
GeneralRe: How to Insert Data In Excel Pin
Anubhava Dimri10-Jul-09 18:16
Anubhava Dimri10-Jul-09 18:16 
QuestionWindows Workflow Foundation Pin
RS.Ratheesh7-Jul-09 2:41
RS.Ratheesh7-Jul-09 2:41 
AnswerRe: Windows Workflow Foundation Pin
Kevin McFarlane7-Jul-09 6:10
Kevin McFarlane7-Jul-09 6:10 
GeneralRe: Windows Workflow Foundation Pin
RS.Ratheesh7-Jul-09 20:19
RS.Ratheesh7-Jul-09 20:19 
QuestionHow to get international date format in lotus notes Pin
kirankatta7-Jul-09 2:37
kirankatta7-Jul-09 2:37 
QuestionRe: How to get international date format in lotus notes Pin
David Crow7-Jul-09 3:07
David Crow7-Jul-09 3:07 
QuestionIs it better to use a class or struct in this case? Pin
Mike the Red7-Jul-09 1:57
Mike the Red7-Jul-09 1:57 

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.