谁知道怎样在vc6.0中使用list的find功能呀 #include <list>中没有find功能呀 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // alg_find.cpp// compile with: /EHsc #include <list>#include <algorithm>#include <iostream>int main( ){ using namespace std; list <int> L; list <int>::iterator Iter; list <int>::iterator result; L.push_back( 40 ); L.push_back( 20 ); L.push_back( 10 ); L.push_back( 40 ); L.push_back( 10 ); cout << "L = ( " ; for ( Iter = L.begin( ) ; Iter != L.end( ) ; Iter++ ) cout << *Iter << " "; cout << ")" << endl; result = find( L.begin( ), L.end( ), 10 ); if ( result == L.end( ) ) cout << "There is no 10 in list L." << endl; else result++; cout << "There is a 10 in list L and it is" << " followed by a " << *(result) << "." << endl;} socket可以发生.avi文件吗? 问个很奇怪的问题 线程钩子无效? catch异常类型应该如何判断? 如何区分显式加载和隐式加载的DLL 如何得到毫秒及德系统时间? 在COM中怎样得到一个SINK的消息映射 怎样通过数据源得到数据库文件的路径和文件名? 请高手解疑关于GetPrivateProfileString 如何在vc中实现对文件。文件夹隐藏? listctrl显示文字问题 表问控件如何动态定位,尤其是继承下来的!
// compile with: /EHsc
#include <list>
#include <algorithm>
#include <iostream>int main( )
{
using namespace std; list <int> L;
list <int>::iterator Iter;
list <int>::iterator result;
L.push_back( 40 );
L.push_back( 20 );
L.push_back( 10 );
L.push_back( 40 );
L.push_back( 10 ); cout << "L = ( " ;
for ( Iter = L.begin( ) ; Iter != L.end( ) ; Iter++ )
cout << *Iter << " ";
cout << ")" << endl;
result = find( L.begin( ), L.end( ), 10 );
if ( result == L.end( ) )
cout << "There is no 10 in list L." << endl;
else
result++;
cout << "There is a 10 in list L and it is"
<< " followed by a " << *(result) << "." << endl;
}