Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a function with the following declaration: unsigned int replaceName(cat* a_cats, unsigned int numCats, const char* origName, const char* newName) replaceName finds each occurrence of

Define a function with the following declaration: unsigned int replaceName(cat* a_cats, unsigned int numCats, const char* origName, const char* newName) replaceName finds each occurrence of a c-string name (origName) in the list of cats (array a_cats which has numCats elements) and replaces that name with c-string newName. The function returns the number of names that were changed. For example, let's pretend we have an array of 24 cat structs in array myCats. Three cats have unfortunately been named "Mullet". Let's change that name to "Mittens". unsigned int numChanged = replaceName(myCats, 24, "Mullet", "Mittens"); numChanged should be equal to 3 after the above line. No cat should be named Mullet in myCats afterwards....or in general. That's abusive to cats.

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_2

Step: 3

blur-text-image_3

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

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

Students also viewed these Databases questions