[ create a new paste ] login | about

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

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

class A{
public:
	A(){}
	A& operator+(int i){ return *this; }

};

A& operator+(A&a, int &i){ i=1; return a; }


int main(){
	int i=0;
	A()+1;
	A()+i;
printf("%d", i);
	return 0;
}


Output:
1
0


Create a new paste based on this one


Comments: