what is the syntax for accessing address of this pointer in C++? -


i trying know address of pointer. tried in following way. can suggest me right method? trying print cout<<&this<<endl; in class member function. compiler generates error c2102: '&' requires l-value.

if i'm not mistaken, std::cout << this should suffice.

class foo { public:     void foo()     {         std::cout << << std::endl;     } };  int main() {     foo foo{};     foo.foo(); } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -