I'm new at C++ and I'm working with someone else's data structure. I've been using Visual C++ 2010 Express. I've had to create objects using their constructor and then manually modify the fields of that object, as well as call functions on the object, and I've used a pointer with the normal format:
Object* newobject = new Object()
and have been working with it using the -> operator (rather than the . one).
However, now I need to pass it as an argument to a method that looks like this:
Method(&object)
And when I try to pass it like so:
someotherobject.Method(newobject);
I get a compiler error:
cannot convert parameter 1 from 'Object *' to 'Object &'
I cannot rewrite the code for the method -- only how I deal or instantiate the object. How can I fix this?