Multiple Choice Quiz

1. If you make a function call TestFunction('a') and all of the following options are available, which version of the function will be called?

2. What is the correct syntax for declaring a template function in C++?

3. How can the logical AND operator (&&) be used in C++?

4. If the following code compiles successfully, which is NOT a possible type for "out_stream"?
  out_stream << "Hello test taker!";

5. When compiling a large C++ project with many files, which of the following is NOT always good advice?

6. What is a difference between pointers and references in C++? +

7. If you have an int variable called "id_num" and you want to convert it to a std::string called "id_name", which of these lines will work?

8. What will the following code output?
  std::vector<int> v{1,2,3,4};
  std::cout << std::accumulate(v.begin()+1, v.end()-1, 0) << std::endl;

9. What does the following line of code do?
  assert(x == 10);

10. Which of the following is an illegal use of the keyword "auto"?


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.