So I have to build a program that shows the outcome of an imaginary battle between two groups of animals. I'm having an issue with making the user select the type of the animal. I have all my data e numerated, but I can't seem to get cin>>type to work.

#include<iostream>
using namespace std;
int main(){

    enum Animal {       //strength of each animal
        Animal_Bunny=1,
        Animal_Chicken,
        Animal_Kitty,
        Animal_Puppy,
        Animal_Wolverine=123,
    };
    struct Armies{
        Animal Type;
        int AD; 
    };

    cout << "Blood Sport Time My Friend.\n"<<"Choose your army 1=Bunny strength 1, 2=Chicken strength 2,\n"<<
            "3=Kitty strength 3, 4=Puppy strength 4, 5=Wolverine strength 123"<<endl; 
    cin >> Type.defense


}

Really any kind of hint would help a grand amount.

Input and number(int) out of your list.
Now use a switch case to determine the enum.

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.