24.03.2016, 22:08
If you are indexing arrays with numbers you are doing something wrong arrays are not really meant to be used like that unless you have good reason which would be very rare. Furthermore why are you using strings to identify items? That is a poor design choice these should all be integer values you would have something like this.
#define ITEM_TYPE_CHAIR 0
#define ITEM_TYPE_BOX 1
From my point of view the problem is all in the design it's flawed and those flaws manifest themselves later with either limitations, undefined behaviour, unneeded loops etc.
#define ITEM_TYPE_CHAIR 0
#define ITEM_TYPE_BOX 1
From my point of view the problem is all in the design it's flawed and those flaws manifest themselves later with either limitations, undefined behaviour, unneeded loops etc.