Please help function class to main

We have a members function in our class:

1
2
3
4
void Graph::Shortest_Path(vector<double>& dist)
{
   .......(here is what it does)
}


But now we have a problem trying to implement it in the main function in our cpp file.. We do not know how to define the vector<double>& dist in the main file? We tried to put it in our public part of our class, so we tried this:

1
2
3
vector<double>& dist) // in our public part of class.h file
Graph Object1; // in our main function cpp file
Object1.Shortest_Path(dist);


But this does not work. Can anyone help us on how to do this?
Last edited on
1
2
3
vector<double> dist; // parameter
Graph Object1; // object
Object1.Shortest_Path(dist); // call member function of object with parameter 
Last edited on
Thank you ShodanHo!
Topic archived. No new replies allowed.