My compiler devC++ seems to think its a"std::vector<agent*, std::allocator<agent*> >"
I'm just glanced at a vector tutorial page five minutes ago for the first time so I can't spot any error though it should be pretty obvious
Yes I did use v[0]. I'm thinking I've messed up the function arguments heres the actual code
Code:
//...heres where the function vector2Agent is called
vector <agent*> parray;
agent2Vector(parray, phead);
//...
agent *vector2Agent(vector<agent*> *parray, agent *phead) //i think the problem is here
{
phead = parray[0]; //doesn't like this
agent *pnext = phead;
for(int x = 1; x < agent::listLength; x++)
{
pnext->setNextAgent(parray[x]); //or this
pnext = pnext->getNextAgent();
}
}
/*actual compiler errors:
In function `agent* vector2Agent(std::vector<agent*, std::allocator<agent*> >*, agent*)':
no matching function for call to `agent::setNextAgent(std::vector<agent*, std::allocator<agent*> >&)'
*/
-Thanks for your help