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

Challenge: RAII - C++ Tutorial

From the course: C++ Best Practices for Developers

Start my 1-month free trial

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.

Contents