InterviewSolution
Saved Bookmarks
| 1. |
Which of the following is not a modifier function in string class?(a) operator+=()(b) operator[]()(c) push_back()(d) erase()The question was asked in a national level competition.The query is from String in section Source Files, Classes and Operator Overloading in C++ of C++ |
|
Answer» CORRECT option is (b) operator[]() To explain I would say: [] operator is USED to access one of the characters of the string objects whereas other FUNCTIONS are used to MODIFY the string in some way. |
|