术语 | CObList::RemoveAll |
释义 | CObList::RemoveAll void RemoveAll( ); 说明: 从该列表中删除所有元素并释放与CObList关联的内存。若列表已经为空,也不产生错误。 当从CObList中删除元素时, 仅从列表中删除对象指针,对象本身得由自己删除。 示例: CObList list; CAge* pa1; CAge* pa2; ASSERT( list.IsEmpty()); // Yes it is. list.AddHead( pa1 = new CAge( 21 ) ); list.AddHead( pa2 = new CAge( 40 ) ); // List now contains (40, 21). ASSERT( !list.IsEmpty()); // No it isn't. list.RemoveAll(); // CAge's aren't destroyed. ASSERT( list.IsEmpty()); // Yes it is. delete pa1; // Now delete the CAge objects. delete pa2; |
随便看 |
|
MFC类库中文详解手册包含4274条MFC类库参考词条,基本涵盖了Microsoft基本类库中的类、全局函数、全局变量和宏的内容,是计算机编程的有利工具。