OK, so as C++ is new to me I am confused. Generally I would pass an object using the "ref" keyword and I'd have no issues retaining the information that was changed in my object when I got back to the main.
Well C++ is different. I have a class that accepts a custom object and while that class has this object I fill in information (vector of objects, a few strings, etc.) Problem is when I get back to the main that information was destroyed. I am thinking I need to send a pointer to the object and not the object itself, but all the samples seem a bit vague or I am just too green to understand them.
So let's say I have a class
class createSurvey
{
public:
Survey createNewSurvey(Survey * S)
{
//do something to fill the survey object
return S;
}
}
Main function call looks like this:
//call the function from the class sending the survey object
//get the survey object back
S = createSurvey.createNewSurvey(S);
OK, Like I said I attempted to send a pointer but I keep getting compiler errors. Any help would be fantastic.
Best Regards,
William