close

#include <iostream>

using namespace std;

class test
{
public:
    test();
    //Default constructor

    ~test();
    //Destructor
};

test::test()
{
    cout << "Default constructor" << endl;
}
test::~test()
{
    cout << "Destructor" << endl;
}

int main()
{
    test * a;
    a = new test;
    //call Default constructor

    //system("pause");
    //可以這邊停一下看做了甚麼事情

    delete a;
    //call Destructor

    return 0;
}
arrow
arrow
    全站熱搜

    grant823 發表在 痞客邦 留言(0) 人氣()