Answer the question
In order to leave comments, you need to log in
Why does the link to the pointer give the wrong address?
Greetings!
There is class A
class A: public InterfaceA
{
A() {}
...
void f() { qDebug()<<"fA"; }
}
class InterfaceA
{
virtual void f()=0;
}
A * clA = new A();
InterfaceA * iA = clA;
typedef InterfaceA * TIA;
void test(const TIA & I ) {
//-- здесь "I" имеет не верный адрес, всегда на 10 больше, чем до вызова
}
test(iA);
A * clA = new A();
Answer the question
In order to leave comments, you need to log in
Why, excuse me, why do you have a constant reference to a pointer in your arguments?
That's why exactly here - a constant reference?
IMHO, you are confusing yourself.
Pass the pointer by value - the code will be simplified, and you will figure it out yourself.
Now, apparently, you manage to get the address of the link itself instead of a pointer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question