Question: C++ program. How to solve this task? Write a function, deleteChar, which deletes any occurrence in the string provided in the first argument, a, of
Write a function, deleteChar, which deletes any occurrence in the string provided in the first argument, a, of the single character which is the second argument, c. The function should return the length of the new string after deleting all occurrences of the letter. Assume the prototype is: int deleteChar(char all, char c); Sample Run: Type in a string: Hi Hello World Enter a letter to delete: o The length of the string before the deletion: 14 The string after deleting the character o' Hi Hell Wrld The new length of the string is: 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
