Infinite loop when allocating memory

I am creating a program to calculate and display call statistics. When the default constructor is called and it goes to allocate memory for an array for the call stats it falls into an infinite loop. I have identified the problem to be at call_DB = new CALLS[CAPACITY]; but I can't seem to get it fixed. Could someone give me some pointers on what to do?

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
CALLS::CALLS()
{
	this->call_DB = NULL;
	
	cout<<"Default Constructor \n";

	
	ifstream input;
	string filename;

	CAPACITY = 5;

	call_DB = new CALLS[CAPACITY];
	
	count = 0;

	cout<<endl<<"Enter the filename: ";
	cin>>filename;

	input.open(filename.c_str());

	while(!input.eof() && count < CAPACITY)
	{
		
		if (!input.eof())
		{
			input>>call_DB[count].cellPhoneNumber;
			input>>call_DB[count].relays;
			input>>call_DB[count++].minutes;
		}
	}

	input.close();
 
}
Topic archived. No new replies allowed.