Question
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
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