Answer:
"EF"
Step-by-step explanation:
Given
String1 = "ABCDEFGHI"
Substring : String1(4,2)
To solve this, one must understand the following
1. The function call operator () is used to overload objects of class type.
2. A copy constructor must receive its argument by reference to prevent an otherwise infinite recursion.
3. overload ( ), doesn't mean that one is not creating a new way to call a function; instead, it is a way to create an operator function that can be passed an arbitrary number of parameters
Having pointed out this,
The string to overload goes thus
String1 = "ABCDEFGHI"
The parameters goes thus
String1(4,2)
To represent this properly, we have
("ABCDEFGHI",4,2)
Which means to return 2 strings starting from the 4th index character.
It should be noted that index starts at 0.
So, the character at the 4th index is "E"
Then, we count 2 characters starting from E (i.e. E, inclusive)
This gives
"EF"
So, the returned string is "EF"