Answered step by step
Verified Expert Solution
Link Copied!

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 called-swapChars 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" 9Gjern 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions