Hello, something of a C++ beginner here with a (possibly) (really) bad
question:
I want to pass a reference of an object from one of the object's
member functions. Is this possible?
so something like this (i've simplified what I'm doing):
MyFuntion(TestClass& some_object)
{
return some_object.val1 * some_object.val2;
}
struct TestClass : public MyClass
{
int val1;
int val2;
}
int TestClass::PassReference
{
int x;
x = MyFunction(this_object); // where this_object is a reference to
this TestClass!
}
How might I get this_object to refer to the correct object? This
might seem ridiculous but I'm working within a DSP plugin architecture
if that helps get me off the hook. Is it possible? If so, is it
dangerous?
thanks,
Stefven Blonqhern