1. What happens if you try to use dynamic_cast to convert a pointer, but the cast fails?
dynamic_cast
2. Why should you use std::make_unique instead of new when constructing a unique_ptr?
std::make_unique
new
unique_ptr
3. Which of the following is NOT a productive development practice for preventing bugs in your code?
4. What happens when you use const_cast to cast away the constness of an object and then modify it?
const_cast
const
5. Which of the following reasons is NOT motivation behind unit testing?
6. How can you reset a unique_ptr to release its ownership and make it point to null?
reset()
7. In Test-Driven Development (TDD), what step is NOT done before the actual feature implementation?
8. If you trigger undefined behavior by writing outside the bounds of an array, which of the following results is possible according to the C++ standard?
9. If you successfully compile your code, why might you still need to worry about syntax errors with this code?
10. Which of the following is NOT a key advantage of trace logging (i.e., frequently printing program state to a file) over breakpoint debugging?
Click Check Answers to identify any errors and try again. Click Show Answers if you also want to know which answer is the correct one.