Need help with finding sum of an array plz.

I need help finding the sum of the expense in this array. Please tell me whats wrong with this and help me fix it. Will appreciate it thank you
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;

int main()
{

    char type[100];
	double total=0;
	double amount;
	int numbers=0;
	int i=0;
	char name[30];
		cout << "enter the employee name:"<< endl;
		cin.getline(name,30);
		cout << "enter the number of expense items:" <<  endl;
		cin >> numbers;
		cin.ignore();
		while (i < numbers)
{
	i++;
		cout << "enter the type of expense:";
		cin.getline(type,100);
		cout << "enter the amount of expense:";
		cin >> amount;
		cin.ignore();	
		for (i=0; i <=numbers; i++)
		{
			total += amount[i];
			i++;
		cout << "total =" << total << endl;
		}
}
}
On line 31, you're subscripting the variable "amount," but it's not an array.
Topic archived. No new replies allowed.