摘要: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...
阅读全文
随笔分类 - STL
摘要:1:CStringstr;str.Format("%d",i);2:std::ostringstreamos;os<<i;CStringcstr_temp=os.str().c_str();2 包含头文件 #include <sstream>
阅读全文
摘要:1std::stringstr_Str="xxx";2CStringstr_CStr;3str_CStr.Append(str_Str.c_str());
阅读全文
摘要:#pragmaonceclassCAnimal{public:~CAnimal(void);virtualCAnimal*Create()const=0;virtualvoidSayHello(void);};#include"StdAfx.h"#include".\animal.h"CAnimal::~CAnimal(void){}voidCAnimal::SayHello(void){std:...
阅读全文
摘要: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...
阅读全文

浙公网安备 33010602011771号