[ create a new paste ] login | about

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

C++, pasted on Mar 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

struct Test{
	static int call_back() {return Test::sint++;}
	int do_it() {return Test::sint++;}
	static int sint;
};

int Test::sint = 10;

int main()
{
	Test t;
	cout << t.do_it() << endl;
	int (*f)() = Test::call_back;
	cout << f() << endl;
}


Output:
1
2
10
11


Create a new paste based on this one


Comments: