26 lines
344 B
C++
26 lines
344 B
C++
#include <iostream>
|
|
#include <stdlib.h>
|
|
|
|
using namespace std;
|
|
|
|
class foo {
|
|
public:
|
|
void *operator *() {
|
|
return NULL;
|
|
}
|
|
void *bar() {
|
|
return &*this;
|
|
}
|
|
};
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
foo f;
|
|
cout << (unsigned long)f.bar() << endl;
|
|
cout << (unsigned long)&f << endl;
|
|
cout << (unsigned long)*f << endl;
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|