Arrays In Calculation C++
You are given an array of doubles of items in a store that have different prices (see template). Write a program that takes the "percent off" discount as input and outputs discounted item prices on one line in the same sequence you are given, separated by a space (" "). my code: int main() { double items[] = {500, 12.4, 94, 45, 3, 81, 1000.9, 85, 90, 1, 35}; double discount = 0; //your code goes here for (double x = 0; x < 11; x++){ cin >> discount; discount = items[x]-items[x]*discount/100; } cout << discount << endl; I don't understand how this won't calculate. I keep getting error that says "error: invalid types 'double [11][double]' for array subscript". I don't know what this means at all. I keep trying to google it but I cannot find anything that helps me solve this.