Eshk. I have fear of the copying.....
Basically, im not even sure my problem has anything to to with shallow/deep copying. In short, i have an object with a constructor that takes variables. What i am trying to do is make a new object, then push it onto a vector (allquestions).
Thing is, im not sure whether Tempquestion will exist after function return. Not cool, hey? I imagine that if it does not exist after return, i will get some wonderful runtime errors to dance around in.... me thinks not.
Code:
Question TempQuestion ( NumberX, NumberY, cOperator, Answer);
AllQuestions.push_back ( TempQuestion );
I thought about it for a while, and thought : can you push and construct at the same time?
something like:
Code:
vector <foo> FooVector;
FooVector.push_back ( some arguments for the constructor )
my other problem is making a deque that hold pointers to Questions. whenever i write :
Code:
deque < * Question > MisAnsweredQuestions;
My compiler tells me i have a parse error before the > (ie, i have screwed up the type).
If any one needs more source....