Home / Expert Answers / Computer Science / please-answer-this-question-correctly-in-c-write-a-function-removeleading-which-removes-the-fir-pa566

(Solved): Please answer this question correctly in C++. Write a function, removeLeading, which removes the fir ...



Please answer this question correctly in C++.

Write a function, removeLeading, which removes the first n characters from a C-string, str. You may use another C-string but you cannot use a variable of type string. No built-in functions can be used. The function has the following heading:

void removeLeading (char str[], int n)

Assume that the C-string has no more than 100 characters and that n ? strlen (str).

Examples: Suppose str is “abcdefgh”. After the call, removeLeading (str, 3), str should be “defgh”. Suppose str is “abcdefgh”. After the call, removeLeading (str, 5), str should be “fgh”.



We have an Answer from Expert

View Expert Answer

Expert Answer


In the required function, to remove n characters from the string we need to process the list from the nth character to its length-1 and start copying from
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe