Tag Archives: C++

More tr1: Static Arrays

One of the old throwbacks to C in C++ is the notion of the “C-style array”: essentially a block of contiguous memory that you allocate either statically, or dynamically with malloc/free or new/delete. These structures were used in a time … Continue reading

Posted in Code | Tagged , , , , , | Leave a comment

Shared pointers, and why you should use them

NOTE: The ideas expressed below are in part based on the book Effective C++ by Scott Myers. He uses auto_ptr in his example, but essentially the lesson is the same. Let’s face it: pointers are dangerous. If you allocate something, … Continue reading

Posted in Code | Tagged , , | Leave a comment