Example:
#include <iostream> using namespace std; class ExampleThis { public: ExampleThis* address(void){ return this; } }; //Main functionn int main () { //creating objects ExampleThis Ex1, Ex2, Ex3; //printing the object's address cout<<"Address of object Ex1: "<<Ex1.address ()<<endl; cout<<"Address of object Ex2: "<<Ex2.address ()<<endl; cout<<"Address of object Ex3: "<<Ex3.address ()<<endl; return 0; }
Output
Address of object Ex1: 0x7ffd6550aa8d Address of object Ex2: 0x7ffd6550aa8e Address of object Ex3: 0x7ffd6550aa8f
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Example:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer