Try this:
Code:
#include <iostream.h>
#include <string.h>
struct weapon
{
char name[15];
char Wclass[6];
char type[6];
int damage;
int plusToDamage;
int toHit;
int plusToHit;
int cost;
};
int main(int argc, char* argv[])
{
weapon broadSword;
strcpy(broadSword.name,"Sword of Might");
strcpy(broadSword.Wclass,"sword");
strcpy(broadSword.type,"slash");
broadSword.damage = 13;
broadSword.plusToDamage = 3;
broadSword.toHit = 52;
broadSword.plusToHit = 3;
broadSword.cost = 25;
cout << broadSword.name << endl;
cout << broadSword.damage << endl;
cout << broadSword.cost << endl;
cout << endl;
return 0;
}
*edited for typos*