goal of this function will be to add an element to an already existing array in...

90.2K

Verified Solution

Question

Programming

goal of this function will be to add an element to an alreadyexisting array in C/C++.

bool add(structure dir[], int& size, const char nm[], constchar ph[]){

//code here

}

add = function name

structure = structure with two fields

{

char name[20];

char phone[13];

}

int& size = # of entries in dir

nm = name that's going to be added

ph = phone that's going to be added.

return true if entry was successfully added, false if there's nomore room.

if entry was added, size will reflect the new number of entriesin dir.

Answer & Explanation Solved by verified expert
4.3 Ratings (674 Votes)
Please look at my code and in case of indentation issues checkthe screenshotsmaincppinclude include using namespace stddefine MAX 1000struct phoneBook structure withtwo    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students