1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
luda_lava [24]
3 years ago
10

Assume that the function call operator() is overloaded for data type String in the usual sense of selecting a substring from a l

arger string. For a String object string 1 with the character string "ABCDEFGHI", what string does string 1( 4 , 2 ) return
a. "CDEF".
b. "CD".
c. "EFGHI".
d. "EF".
Mathematics
1 answer:
krek1111 [17]3 years ago
6 0

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"

You might be interested in
Which graph best describes this?
NemiM [27]
A, Is the answer according to my calculations.
8 0
3 years ago
Read 2 more answers
Hello, PLEASE ANSWER ASAP!!! Don't report my question or give me false answers but I'm freaking out. I was biking home from scho
faltersainse [42]

Answer:

Kuroo Here!

Step-by-step explanation:

Just Tell the truth. Your parents don't want you do die. So Just say the truth. There is nothing good after telling lies.

5 0
3 years ago
Read 2 more answers
A salesperson works 40 hours per week at a job where she has two options for being paid. Option A is an hourly wage of ​$27. Opt
saul85 [17]

Answer:

1 week

Step-by-step explanation:

6 0
3 years ago
What is equal to sin(34)
Aleksandr-060686 [28]

Answer: sin(34) = 0.52908268612

7 0
2 years ago
Read 2 more answers
Topic: 6th Grade Statistics/Probability <br> PLEASE EXPLAIN OR I WILL GIVE A ONE STAR RATING!
VLD [36.1K]

Answer:

so if we add all the frequency's together we get 24+10+8+3+30+15=90

90 divided by 6 is 15 so the answer is D

5 0
3 years ago
Read 2 more answers
Other questions:
  • A rectangle has a length of 34 and an area of 2930, what is its width?
    12·2 answers
  • Formula to get the energy of an object
    14·2 answers
  • Use the set of clues in the equations below to find the value of each variable .
    15·1 answer
  • A customer went to a garden shop and bought some potting soil for 12.50 and 5 shrubs.The total bill was 62.50. Write and solve a
    5·1 answer
  • Which expression is equal to 5+6+7+8+9?
    8·1 answer
  • ILL BRAINLIEST YOU <br> PLEASE HELP ME
    6·1 answer
  • Please help quick!!
    13·2 answers
  • Najma is buying four sweaters that cost $14.99 each. She has two gift
    8·2 answers
  • Suppose a triangle with the vertices A(-7, -8), B (-4,6)
    9·1 answer
  • X=4/5 (x+10)<br> pls ans fast!!!!!!!!!!!!!!!!!!!!1
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!