[ create a new paste ] login | about

Link: http://codepad.org/7CvN2JTm    [ raw code | output | fork ]

C++, pasted on Apr 27:
#include <iostream>

struct A {
	int field;
	int method();
	void *self();
};

int A::method() {
	return 42;
}

void *A::self() {
	return this;
}

int main() {
	A *a = NULL;
	std::cout << a->method() << std::endl;
	std::cout << a->self() << std::endl;
	return 0;
}


Output:
1
2
42
0


Create a new paste based on this one


Comments: