# include <iostream>
# include <string>
using namespace std;
class A
{
public:A()
       {
           cout<<"constructing an object of A"<<endl;
       }
       ~A()
       {
           cout<<"Destructing an object of A"<<endl;
       }
};
void temporary()
{
    A b;
}
int main()
{
    cout<<"----begin main---"<<endl;
    A a;
    temporary();
    cout<<"*******"<<endl;
    A c;
    A d;
    cout<<"----end main---"<<endl;
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-06-15
  • 2022-03-01
  • 2021-08-03
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2021-06-16
相关资源
相似解决方案