Question: Please fix my code in the picture: In C + + Member function copy _ piece, which returns a specified substring. The function has the

Please fix my code in the picture: In C++ Member function copy_piece, which returns a specified substring. The function has the location as input and number of characters to read. Function call can read:
copy_piece(&text[3],4);
My code: StringVar StringVar::copypiece(int position, int length1){
if (position > length()-1|| position 0)
{
cout "You are not able to do that, exiting now...";
exit(1);
}
StringVar result();
return result;
}
Please fix my code in the picture: In C + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!