Oh, I should have been more specific.
Here's a portion of my main program:
Code:
string filename;
cout << "Input file: ";
cin >> filename;
cout << endl;
ifstream ins;
ins.open(filename.c_str());
assert (ins);
ins >> T;
cout << T << endl << endl;
//loops the number of times that T calls
for(size_t b = 0; b < T; b++)
{
dis = 0;
N = 0;
readGraph (ins, W, N);//calls read graph
//etc
}
And the input file looks like this:
Code:
10
2
1.4 0.4
1.0 0.3
1
3.4 5.0
10
4.2 1.6
0.3 4.6
6.2 0.0
8.9 6.8
3.9 6.7
6.0 3.3
9.7 7.4
1.5 0.7
6.5 8.9
2.1 3.0
1
6.6 7.3
................... etc
As you can see, it reads in the 10 as the number of times to run through the loop that calls readGraph. And the second time through readGraph there is a problem. Sorry for not being so clear, but thank you for the reply. If you could provide any more help, that would be terrific.