-
struct question
One quick question... probably easy, I'm just a little confused.
Code:
struct sword_class
{
char name[15];
int damage;
int price;
};
sword_class swordz[3] = {
{"Short Sword", 6, 50},
{"Long Sword", 8, 100},
{"Dagger", 3, 10}};
If you can, how would you for example be able to print to the screen a part of this {"Short Sword", 6, 50}, would I be able to output the price separately from the others?
Thanks in advance,
-Psycho
-
Yes, with -
cout << swordz[0].price;
-
ohhhh
thanks again
-Psycho