To address the problem at hand, you're assigning into objects which aren't constructed yet:
Item Letter =
{
Letter.itemName = "Letter",
Letter.itemDescription = "...",
Letter.itemNumber = 1,
Letter.haveItem = true
};
You're assigning into members of Letter
when specifying the arguments for initialisng Letter
. That won't do. What you were after is:
Item Letter =
{
"Letter",
"...",
1,
true
};
However, the code in general shows you'd better start from the basics with a good book to guide you, as I've said in the comments. For example, you definitely do not want to use goto
instead of a loop. And the Item
class could use a constructor.