/***************************************************
Construction、DeConstruction
new、delete 、list、list.clear()
version 1.0.8, May 10th, 2016
Copyright (C) 2015-2016 Acheld CHEN
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Acheld CHEN
http://blog.csdn.net/acheld
****************************************************/
///
//other cpp file call the Target Function
///
void CXContainerTestDlg::OnBnClickedButton1()
{
// TODO:
extern XContainerMgr* theXContainerMg
类和列表的动态创建和销毁,new、delete,clear
最新推荐文章于 2024-09-03 20:56:06 发布
这篇博客介绍了C++中动态内存管理的使用,包括使用new和delete创建和销毁对象,以及如何使用list容器进行元素的动态管理,特别是list.clear()方法用于清空容器的内容。通过示例代码展示了类和对象的生命周期管理,以及内存的正确释放,防止内存泄漏。
摘要由CSDN通过智能技术生成