:: :: :: 联系 :: :: 管理 ::

随笔分类 -  STL

摘要:1std::vector<int>vctr_test;2vctr_test.push_back(1);3vctr_test.push_back(2);45intnCount=vctr_test.size();6int*array_test=newint[nCount];7for(inti=0;i<nCount;++i)8{9array_test[i]=vctr_test[i];1... 阅读全文
posted @ 2006-08-11 11:26 dtor 阅读(360) 评论(0) 推荐(0)

摘要:1:CStringstr;str.Format("%d",i);2:std::ostringstreamos;os<<i;CStringcstr_temp=os.str().c_str();2 包含头文件 #include <sstream> 阅读全文
posted @ 2006-05-09 17:21 dtor 阅读(733) 评论(2) 推荐(0)

摘要:1std::stringstr_Str="xxx";2CStringstr_CStr;3str_CStr.Append(str_Str.c_str()); 阅读全文
posted @ 2006-05-09 16:07 dtor 阅读(1850) 评论(3) 推荐(0)

摘要:#pragmaonceclassCAnimal{public:~CAnimal(void);virtualCAnimal*Create()const=0;virtualvoidSayHello(void);};#include"StdAfx.h"#include".\animal.h"CAnimal::~CAnimal(void){}voidCAnimal::SayHello(void){std:... 阅读全文
posted @ 2006-03-25 13:25 dtor 阅读(402) 评论(0) 推荐(0)

摘要:std::vector<int>IntTest;for(inti=0;i<10;++i){IntTest.push_back(i);}for(std::vector<int>::iteratoriter=IntTest.begin();iter!=IntTest.end();++iter){std::cout<<*iter<<std::endl... 阅读全文
posted @ 2006-03-25 12:03 dtor 阅读(11570) 评论(1) 推荐(0)