@binoNocino,
There are several lines in "your" code that are causing me the jitters.
push_back() is a member function, and you are (presumably) inputting a string, not a member function. Probably you can replace
inFile >> test.push_back(i);
with
1 2 3
|
string something;
inFile >> something;
test.push_back( something );
|
Alternatively, if (and only if) you had predeclared test[] with the appropriate number of entries then you could input directly into it without using push_back() at all:
inFile >> test[i];
But there is not enough information about what else you are doing or the format of the input file to decide which is more appropriate.
As far as I can see there is no way of getting the values in
vector<string> test
out of this function, so something needs to be refactored. You haven't shown enough code to advise.
The line
while(inFile.eof)
is giving me nightmares. But if you know that there are 54 strings to input (54 is another magic number, BTW) then you don't need that outer loop anyway.
This looks a bit of an odd way to input a directed graph: why would the entries in the input file be strings?
Your code looks as if you are trying to amend somebody else's function.