Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 1.2 KB

File metadata and controls

25 lines (13 loc) · 1.2 KB

C++ Memory Management

destructors.cpp

Video (20:44): Example of destructor & copy constructor

Example of constructor, destructor, and copy constructor. The output here is pretty verbose because the intention is to understand when the different functions get called. In general, constructors, destructors, and copy constructors (and especially overloaded operators) should avoid output to stdout.

headers

Video (15:14): Example of using C++ header files and review of Inheritance

This example walks through using C++ header files. It also reviews inheritance, polymorphism, & virtual methods and discusses the use of the override & explicit keywords.

structvsclass.cpp

Video (13:52): Comparing structs & classes in C++

Differences and similarities between structs & classes in C++. Also an example of usin g a char pointer to view memory contents.

memory.cpp

Video (26:28): More complete example of memory management and the rule of 3

Demonstrates using delete vs delete[], value & reference semantics, copy constructors, and overloading the = operator.