182k views
5 votes
A reason to overload the ________ is to allow you to write classes that have array-like behaviors.

1 Answer

4 votes
I believe the answer is: square brackets [ ] operator

in C++, square brackets [ ] operator could be used to outputting an array in a class constructor that declared using pointers. The constructor should allocate an array and copy values from the pointer argument and should be returned in the element in the array you allocated.
User Cengkuru Michael
by
8.6k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.