staram się znaleźć adres this
wskaźnika, ale kod ten pokazuje dziwne błąd:adres tej
#include <iostream>
using namespace std;
class Base
{
public:
void test()
{
void *address_of_this =&this;
cout<<address_of_this<<endl;
}
};
int main()
{ Base k;
k.test();
return 0;
} //error non-lvalue in unary'&'
można wyjaśnić ten błąd?
Wskazuje również, co jest nielegalne w przyjmowaniu adresu this
?
Spróbuj dodać spację po znaku = = – Alexander