I want to realize math operations and write in the array, I send parameters as int, but error says invalid types 'int[int]' for array subscript.
string clients[5][2];
string products[7];
string strPrices[7];
int prices[7];
int resumen[5][2];
void selectOption(int i, int opc, int cantidad){
if(opc==1){
clients[i][1] = ""+cantidad+products[0];
} else if(opc==2){
clients[i][1] = ""+cantidad+products[1];
} else if(opc==3){
clients[i][1] = ""+cantidad+products[2];
} else if(opc==4){
clients[i][1] = ""+cantidad+products[3];
} else if(opc==5){
clients[i][1] = ""+cantidad+products[4];
} else if(opc==6){
clients[i][1] = ""+cantidad+products[5];
} else{
clients[i][1] = ""+cantidad+products[6];
}
prices[i][0] = i+1; //--- error: invalid types ‘int[int]’ for array subscript
prices[i][1] = prices[i]*cantidad; //--- error: invalid types ‘int[int]’ for array subscript
}
pricesa 1D array or a 2D array? Because at the moment half of your code says it's a 1D array and the other half says it's a 2D array. First decide what you really want it to be, then fix the code.