摘要: vectorvector::erase函数iterator erase ( iterator position ); iterator erase ( iterator first, iterator last );Removes from the vector container either a single element (position) or a range of elements ([first,last)).Because vectors keep an array format, erasing on positions other than the vectorendal 阅读全文
posted @ 2012-03-27 14:47 foreverlearn 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 内容来自《21天C++》和《efective c++》c风格的类型转换char * pszString = "hello world!";int* pBuf = (int *)pszString;c风格的类型转换实际上是强迫编译器根据程序员的选择来解释目标对象C++提供了一种新的类型转换运算符,专门用于继承的情形,这种情形在c中并不存在4个类型转换运算符如下:const_cast 通常用来将对象的常量性转除(cast away the constness)。它是唯一有此能力的C++-style转型操作符。dynamic_cast用来执行继承体系中安全的向下转型或跨系转型动作 阅读全文
posted @ 2012-03-27 13:39 foreverlearn 阅读(263) 评论(0) 推荐(0) 编辑