我有几个不同“i”的变量,例如 wip0、wip1、... wip26。每一个都是整数的集合。这可能很容易,但我找不到答案。
如何创建一个函数来更新给定变量?
我有一个更新特定变量的函数,但我不想创建 27 个函数。
我现在有:
updateWip(int type, int quantity){
int temp;
temp = wip.get(type);
temp = temp + quantity;
wip.set(materialType, temp);
}
我需要这样的东西:
updateWip(int type, int quantity, int station)