标签:des style http color io os ar 使用 for
vector::erase Removes?an?element?or?a?range?of?elements?in?a?vector?from?specified?positions. iterator?erase( ???iterator?_Where ); iterator?erase( ???iterator?_First, ???iterator?_Last ); ?Return?Value An?iterator?that?designates?the?first?element?remaining?beyond?any?elements?removed,?or?a?pointer?to?the?end?of?the?vector?if?no?such?element?exists. ? ? ? ? ?Example //?vector_erase.cpp //?compile?with:?/EHsc #include?<vector> #include?<iostream> int?main(?) { ???using?namespace?std;??? ???vector?<int>?v1; ???vector?<int>::iterator?Iter; ??? ???v1.push_back(?10?); ???v1.push_back(?20?); ???v1.push_back(?30?); ???v1.push_back(?40?); ???v1.push_back(?50?); ???cout?<<?"v1?="?; ???for?(?Iter?=?v1.begin(?)?;?Iter?!=?v1.end(?)?;?Iter++?) ??????cout?<<?"?"?<<?*Iter; ???cout?<<?endl; ???v1.erase(?v1.begin(?)?); ???cout?<<?"v1?="; ???for?(?Iter?=?v1.begin(?)?;?Iter?!=?v1.end(?)?;?Iter++?) ??????cout?<<?"?"?<<?*Iter; ???cout?<<?endl; ???v1.erase(?v1.begin(?)?+?1,?v1.begin(?)?+?3?); ???cout?<<?"v1?="; ???for?(?Iter?=?v1.begin(?)?;?Iter?!=?v1.end(?)?;?Iter++?) ??????cout?<<?"?"?<<?*Iter; ???cout?<<?endl; } v1?=?10?20?30?40?50 v1?=?20?30?40?50 v1?=?20?50 ?Requirements Header:?<vector> Namespace:?std ? ? ?
本文使用?书画小说软件?发布,内容与软件无关,书画小说软件?更惬意的读、更舒心的写、更轻松的发布。
MSDN?中?对vector::erase()的解释.xml
标签:des style http color io os ar 使用 for
原文地址:http://www.cnblogs.com/shuilan0066/p/4031935.html