Posted By: PrenceOfDarkness
Array of pointers to structures. - 12/01/10 17:27
Hey guys I'm having a but of a problem. I hope it doesn't get to confusing so I'll try to explain it as simple as possible. I'm trying to make a pretty complicated inventory system and in order to do so each item slot needed a struct. I then wanted to keep the different items organized inside another struct (the inventory). The best way I could think of doing this was to create an array where each array element was a pointer to an item. I'm having a real hard time defining this can someone help please I keep getting syntax errors.
Code:
typedef struct { int itemNum; int itemID; int iSpell; int minD; int maxD; int arm; int quant; int pref; int suf; int sock1; int sock2; int sock3; } _item; typedef struct { _item* item[31]; }_inventory