Can I get some advise? Instead of returning the vector from the function as a pointer or a reference, I am returning it as a string which contains the address. (I had good reason for this).
^That part was successful, the part I can't seem to figure out is, how to take that returned string(which holds an address of a vector) and make a new vector with it.
This is the vector (of type struct) that was passed from the function in a string containing its memory address:
vector<intructor> intruct;
Converting vector's address to a string: successful
string address;
stringstream ss;
ss << &depart;
ss >> address;
return address;
My attempt to convert it back in a new vector: failed
vector<intructor> getIntructorVector(string filePath)
{
stringstream ss;
string address = VectorCreator(filePath);
vector<intructor> intruct;
ss << address;
ss >> &intruct;
return intruct;
}
If you need to know, this is what the vector holds:
struct intructor {
string name;
string dept;
int id;
};