The rules for using operator [] are different from other operators. Which of the following statements are correct? Explain.
a. Operator [] may be overloaded only as a static member function.
b. The index may not be a char.
c. When writing an overloading function for operator [], the [] follows the keyword operator, followed by one index parameter declaration between parentheses.
d. The index value must be an integer type.
e. The index may not be an enum.
a) c) are correct
Explanation: b), c) e) the index values may be of any type.
You might also like to view...
Excel stores dates as numbers with 0 being 0 CE according to the Gregorian calendar
Indicate whether the statement is true or false
DES (Data Encryption Standard) is the newest and strongest encrypted algorithm available today
Indicate whether the statement is true or false
What is the life span of a memory card? Include the guidelines for care of memory cards.
What will be an ideal response?
-24 % -5 is _____
a. 3 b. -3 c. 4 d. -4 e. 0