我正在进行一个C++项目,但是我想知道如何在析构函数中调用类/结构体的成员函数。我的项目其余部分进展顺利,所以我只需要知道这一点就可以完成它 :)
~Drink()
{
cout << "hi";
cout << "I want to know how to summon a member function from a destructor.";
}
int Drink::dailyReport()
{
cout << "This is the member function I want to call from the destructor.";
cout << "How would I call this function from the destructor?"
}
请正确编写语法!提供如何在析构函数中调用成员函数的示例将很好!