[ create a new paste ] login | about

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

C++, pasted on Jul 12:
class Test {
public: 
    int myint; 

public:
    Test() {
        myint = 0;
    };

    void test() {
        printf("%d\n", myint);
        int myint = 1;
        printf("%d\n", myint);
    };
};

int main() {
    Test* t = new Test();
    if (NULL != t) { 
        t->test();
        delete t; 
    }
}


Output:
1
2
0
1


Create a new paste based on this one


Comments: