char animal_holder[12]={'A','B','C','D','E','…

char* animal_master[12]=
{"Ant","Bear","Cat","Dog","Eagle","Gan…

I've used the srand and rand function to get randomly a letter from the animal_holder array. Now if the program inputs ABCD....ABCD should be equivalent to ant bear cat dog from the string animal master....HOW TO DO THAT????

easy...just use the array indices of the two arrays. If the program picks the value "B", you get the array index as 1. Then fetch from the animal_master array, the value with the array index as 1. This value will be "Bear".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.