Code:
/*...use with C99+ or C++ compatible compilers,
otherwise, use a #define for "count"...*/
const int count = 5;
char names[count] = { { "Spider" },
{ "Serpent" },
{ "Orc" },
{ "Goblin" },
{ "Hound" } };
int hp[count] = { 55, 60, 50, 40, 45 };
int att[count] = { 15, 25, 25, 10, 25 };
int main()
{
char *monnm[30];
char monnm2[30][50];
int monhp;
int monatt;
int monchs;
monchs = rand()%5;
monnm[0] = names[monchs]; //...beware! you do not "own" that string!
strcpy(monnm2[0], names[monchs]); //...but here you do...
monatt = att[monchs];
monhp = hp[monchs];
return 0;
}