Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a function called - swapChars which uses a pointer to swap one char for another. Your function should take three parameters. The first parameter
Create a function calledswapChars which uses a pointer to swap one char for another. Your function should take three parameters. The first parameter is the string to search through. The second parameter is the char to search for. The third parameter is the char to swap with. Your function should swap the first occurrences of the two characters. For example, Suppose you have the following String "this is a test" Gjern SEye and the first char to swap is h and the second char to swap is s Your function should then arrange the String like this: tsih is a test. Note: You must use pointers to perform this task. This means the use of array notation will not be allowed. You must swap the characters. Replacing characters with the parameters is not acceptable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started