Ok so i've got a class called thing. Here's the constructor's parameters.
thing(string name,int x,int y,int whichscene,bool pickedup,bool canbepickedup,string pngname,string pnginvicon,int filesize,string worlddescription,string invdescription)
Here's my object I want to copy into the vector.
thing tree1("Tree",300,240,1,false,false,"..\\images\\tree.png","..\\images\\tree.png",1,"This is a tree","NULL");
Here is my vector
vector<thing> allthings;
allthings.resize(50);
That should be all the relevant code. What i'm trying to accomplish is this.
allthings[0].name = tree1.name;
allthings[0].x = tree1.x;
And so on for every data member set in the tree1 object. Here's the code I wrote to try and accomplish that.
allthings[0] = tree1;
This gives me errors.
c:\program files\microsoft visual studio 9.0\vc\include\vector(713) : error C2512: 'thing::thing' : no appropriate default constructor available
c:\program files\microsoft visual studio 9.0\vc\include\vector(712) : while compiling class template member function 'void std::vector<_Ty>::resize(unsigned int)'
with
[
_Ty=thing
]
c:\documents and settings\kenny\desktop\adventure\adventure\adventure.cpp(22) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
with
[
_Ty=thing
]
I don't know why i'm getting those errors or what they even mean. That second one looks like it's complaining about my vector.resize(), but I don't see anything wrong with it. The other two i'm just completely clueless about what they mean. Any ideas?