[ create a new paste ] login | about

Link: http://codepad.org/ZemBrIRe    [ raw code | output | fork | 1 comment ]

tauk - C++, pasted on Oct 22:
1
2
3
4
5
6
7
8
9
10
11
12
class Hello {
public:
    //code written in class definition to save space - this is OK
    Hello() { cout << "Hello\n"; };
    ~Hello() { cout << "Bye\n"; };
};
int main(int argc, char *argv[])
{
    Hello h1;
    Hello *h2 = new Hello();
    delete h2;
}


Output:
1
2
3
4
Hello
Hello
Bye
Bye


Create a new paste based on this one


Comments:
posted by 3m on Jan 19
i did not get same output when i run the code>
my output:
Hello
Hello
Bye
reply