From the course: Secure Coding in C++

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Challenge: Smart pointers

Challenge: Smart pointers - C++ Tutorial

From the course: Secure Coding in C++

Challenge: Smart pointers

(upbeat music) - [Instructor] It's time for your next challenge. This time, you'll work on the same application that leaks memory because it lacks a destructor. Your task is to upgrade the DataChunk class to use smart pointers instead of raw pointers. While you're at it, ask yourself this question. Do you still need a destructor? Lastly, don't forget to compile your code using the -fsanitize flag so you get a report if a memory leak were to occur. This should take you about 15 minutes. When you're done, watch the next video for my solution.

Contents