My sad Array-pit...

I am slowly understanding the very basics to C++ and thought I could do some useful array information containers looking something like this:

int dexterity = rand() % 10;
int strength = rand() % 10;
int personality[2] = {dexterity, strength};
string soldiers[3] = {"Jimmy", "Kent", "Leif"};

soldiers[] = personality[]; ?

Now, how do I get a personality mix to stick to a particular soldier?

I am not ready to grasp things like pointers and vectors yet, I don't think.
My brain shuts down when faced with the dark unknown.

Thanks
You should make a struct
eg:
1
2
3
4
5
6
struct Soldier
{
   string name;
   int dexterity;
   int strength;
};

http://www.cplusplus.com/doc/tutorial/structures/
Topic archived. No new replies allowed.