LearnFrenzy
Sign in Take a free test

Operator Overloading · Operator Overloading MCQ · Question 6

How is postfix ++ declared? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 6 Back to Exercise

Which declaration overloads the postfix increment x++?

  • A T& operator++();
  • B T operator++(int); Correct
  • C T operator++(T);
  • D T& operator++(++);
Correct Answer: Option B

The unused int parameter distinguishes postfix from prefix.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links