🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Operators and Templates: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Why is operator<< usually a non-member (often friend) function?
  2. Q2. Which operator can NOT be overloaded in C++?
  3. Q3. What does this print? (code)
  4. Q4. Is friendship inherited by derived classes?
  5. Q5. What is vector<int an example of?
  6. Q6. What does this print? (code)
  7. Q7. For a member operator+, what does the expression a + b become?
  8. Q8. What does this print? (code)
  9. Q9. When does the compiler generate code from a function template?
  10. Q10. What does a friend function of a class get that an ordinary function does not?