So I'm lazy and want to try and make and use a small lookup array on one line. I've tried this: int cap = {20,50,200,9001}[itemId-1]; but the compiler doesn't like it. Is there a way to do this or do I have to just suck it up and use two statements?
Well yeah, that allows the problem to be solved in two statements but I would like to do it in one. cap in this case is a scalar, not an array. I would essentially like to quickly set it to an element of an array as in my above code.