[ create a new paste ] login | about

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

C++, pasted on Feb 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
class A { public: int v; A& get() { return *this; } };
A& func(){ A a; a.v=3; return a.get(); }

int main() {
    A& v = func();
    v.v=9;

    int over[5000] = {1};
    std::cout << v.v;

    return 0;
}


Output:
1
9


Create a new paste based on this one


Comments: