下面乱七八糟的程序中,注释了的在vc中就同不过,在c++builder却可以,真郁闷,
int main(int argc, char* argv[])
{
vector<int> ivec;
for(vector<int>::size_type ix=0;ix!=10;++ix)
ivec.push_back(ix*2);
list<int> ilist(ivec.begin(),ivec.end());
// deque<int> idque(ilist.begin(),ilist.end()); //error,why?
for(list<int>::iterator iter = ilist.begin();iter!=ilist.end();++iter)
cout<<*iter<<" ";
cout<<endl;
/*error again, but not in the c++builder
char *words[]={"lichen","chenshuang","zhangyu","huopi","shibushi"};
size_t word_size = sizeof(words)/sizeof(char*);
vector<string> svec(words,words+word_size);
*/
int ai[]={1,2,3,4,5,6,7,8};
vector<int> ivec1(ai,ai+8);
if(find_val(ivec.begin(),ivec.end(),3))
cout<<"find!"<<endl;
return 0;
}