Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provide a screenshot of the code code in c Write and run a C program that performs the following: Create three arrays of characters named

Provide a screenshot of the code
code in c
image text in transcribed
Write and run a C program that performs the following: Create three arrays of characters named myText of size 40, oldText of size 4 and newText of size 4. prompts the user to enter three strings and store them in the three character-arrays Print the three strings Passes the three stringsto a C function named repalceStr. The function receives three Strings in the form of pointer to character as in the following: void repalceStr(char *text, char * oldval, char * newval) Your function should replace all occurrences of the string oldval by the newval. Assume that oldval and the newval have the same length and are distinct. For example, if the arrays have the following data: myText array has "BABCAACE EAABC ZZADA" oldText has "ABC" newText has "POZ" then findAndRepalce(myText, oldText, newText); should modify the characters in myText to "BPOZAACE EAPQZ ZZADA" in the main, print the three strings after the function call

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago