Multiple Choice Quiz

1. According to the core guidelines, what is a good technique to reduce the number of parameters to a function?

2. Which of the following is NOT a difference between enum and enum class?

3. How do you speed up your compilation using CPU architecture-specific optimizations?

4. Which of the following is NOT an advantage of using std::unique_ptr over std::shared_ptr?

5. Which of the following will not compile?
Assume std::vector<int> vec = GetVector();

6. Why should I try to avoid casting away const on a variable even when I know that I am not changing its value?

7. According to the core guidelines, where should you set the default values for member variables in a class?

8. If two variables are defined as const int * x and int const * y, what is the difference in their types?

9. What order are a class' member variables initialized in?

10. Why is it important to use std::unique_ptr in a function that may throw an exception in the middle?


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.