Question: 5 ) Operator [ ] Rules HomeworkUnansweredDue Dec 1 3 th , 1 0 : 0 0 AM Mark as: None correct answers are hidden

5) Operator[] Rules
HomeworkUnansweredDue Dec 13th,10:00 AM
Mark as:
None
correct answers are hidden
Which of the following is true when overloading operator []?
Multiple answers:Multiple answers are accepted for this question
Select one or more answers and submit. For keyboard navigation...Show more
a
it should return a reference to the element
b
it should return a copy of the element and be a const method
c
it should validate the 'index' provided
d
there are typically two overloads per class (for completeness)
e
it should return an incorrect value/memory location when the index is invalid garbage in, garbage out

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!