I know I probably have to rethink my approach, but here's my problem:
I have a 1D array, let's call it Inventory, with 10 cells, each containing a different value.
I'm traversing this array, and I check each value to another 1D array, which contains all the unique values.
The Unique Item array starts off empty and with a width of 1. Each time I find a value in Inventory that doesn't exist in Unique Items, I add this item to Unique Items.
However if I try to change the width of Unique Items (either by set size, or by push back), so it can fit a second item (and then a third) the program crashes.
This is the barest minimum of code, and it freezes completely.
It's probably causing an infinite loop, because "for each element" starts iterating once (since the width is 1) and then I try to mess with the width.
Any ideas? Thank you!