From the course: C++ Best Practices for Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: RAII - C++ Tutorial
From the course: C++ Best Practices for Developers
Challenge: RAII
- [Instructor] Are you ready for one more challenge? This time create your own resource that demos RAII. It should have a constructor and a destructor. Its constructor should accept one parameter, an integer, the resource ID. During construction and destruction, display the resource ID to the console. Be sure to test your code with no exceptions and with an exception. Give yourself five or 10 minutes to complete this challenge.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.