Access Violation Help

I am keep getting error on access violation. Program suddenly stops another code page appears. I do break. I am closing iosfwd file and then do continue. There is no actual error. I don't understand what is the problem. I am beginning of the code and I did this many times never get an error like that. I appreciate for help.

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  #include <iostream>
#include <fstream>
#include <string>

using namespace std;

//Creating class for the city

class City

{
public:
	string name;
	int numOfOutages;
	int totalCust;

};

int main()

{
	City data[41];
	int count = 0;

	//Reading from File

	ifstream inFile("C:\\Users\\Ruk\\Documents\\IOFiles\\lipa.txt");

	if (inFile.good())
	{
	
		while (!inFile.eof())
		
		{
			inFile >> data[count].name;
			inFile >> data[count].numOfOutages;
			inFile >> data[count].totalCust;
			count++;
		}
	}
	
	inFile.close();

	

	system("PAUSE");
	return 0;




}
Topic archived. No new replies allowed.