[ create a new paste ] login | about

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

C++, pasted on Jun 21:
#include <iostream>

using namespace std;

class Test
{
public:
    Test()
    {   
        printf("construct ..\n");
    }   

    ~Test()
    {   
        printf("destruct...\n");
    }   
};

Test Get()
{
    Test t = Test();
    return t;
}

int main(int argc, char *argv[])
{
    Test t = Get();
    return 0;
}


Output:
1
2
3
4
5
construct ..
destruct...
destruct...
destruct...
destruct...


Create a new paste based on this one


Comments: