Assertion failure

Hey guys. I'm trying to load into a 2d array from a text file of integers. The array loads fine, but after loading and printing the 2d array I get an assertion failure. Ideas?

Here is the load:

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
 ifstream myfile;
			string fileName;//name of file
			cout<<"Please enter file name: ";
			cin >> fileName;
			myfile.open(fileName.c_str(), ios::in);
			int size;
			//load files if files exist
			if(myfile.good()){
				cout<<"successful"<<endl;
				myfile >> size;
				Graph e = Graph(size);
				while(!myfile.eof()){
					
					for(int row = 0; row < size; row++){
						for(int col = 0; col < size; col++){
						myfile >> e.a[row][col];//fills array
						/*if(e.a[row][col] == 0){
							e.edge[row][col] = false;
						}else{
							e.edge[row][col] = true;
						}*/
						cout << e.a[row][col];
						}
						cout << endl;
					}
			
				}

Anyone? Help?
I know nothing of this error, but a quick Google search returned this. Perhaps it will help...
http://stackoverflow.com/questions/2755264/what-debug-assertion-failed-mean-and-how-to-fix-it-c
Topic archived. No new replies allowed.