티스토리 뷰
#include <iostream>
#include <vector>
#include <string>
#include <memory>
#include <tchar.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
vector<shared_ptr<string>> svec;
svec.push_back(shared_ptr<string>(new string("aaa")));
svec.push_back(shared_ptr<string>(new string("bbb")));
svec.push_back(shared_ptr<string>(new string("ccc")));
for(vector<shared_ptr<string>>::iterator it = svec.begin(); it != svec.end(); it++)
cout << **it << endl;
vector<shared_ptr<int>> ivec;
for(int i = 0; i < 5; i++)
ivec.push_back(shared_ptr<int>(new int(i)));
for(vector<shared_ptr<int>>::iterator it = ivec.begin(); it != ivec.end(); it++)
cout << **it << endl;
return 0;
}
#include <vector>
#include <string>
#include <memory>
#include <tchar.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
vector<shared_ptr<string>> svec;
svec.push_back(shared_ptr<string>(new string("aaa")));
svec.push_back(shared_ptr<string>(new string("bbb")));
svec.push_back(shared_ptr<string>(new string("ccc")));
for(vector<shared_ptr<string>>::iterator it = svec.begin(); it != svec.end(); it++)
cout << **it << endl;
vector<shared_ptr<int>> ivec;
for(int i = 0; i < 5; i++)
ivec.push_back(shared_ptr<int>(new int(i)));
for(vector<shared_ptr<int>>::iterator it = ivec.begin(); it != ivec.end(); it++)
cout << **it << endl;
return 0;
}
'Code > C C++' 카테고리의 다른 글
| [C++] polymorphism.h (0) | 2010.05.17 | 
|---|---|
| [C++] How to: Convert Between Various String Types (0) | 2010.05.17 | 
| [MFC] Simplified MFC Structure (0) | 2010.04.24 | 
| [MFC] Simplest MFC Program (0) | 2010.04.23 | 
| [C++] Regular Expressions Class: regex (0) | 2010.04.18 | 
                      공지사항
                      
                  
                
                  
                  
                    최근에 올라온 글
                    
                
                  
                  
                    최근에 달린 댓글
                    
                
                  
                  - Total
 
- Today
 
- Yesterday
 
                    링크
                    
                
                  
                  
                    TAG
                    
                
                  
                  - Microsoft
 - Phalanger
 - Automation
 - Regular Expressions
 - jre
 - windows
 - iText
 - AdSense감추기
 - ScreenHunter
 - Service pack
 - WinAutomation
 - .net framework
 - 애드센스감추기
 - Rollback Rx
 - READYSTATE_COMPLETE
 - autohotkey
 - DotNetMagic
 - Sample Code
 - iTextSharp
 - c#
 - AxWebBrowser
 - AdSense숨기기
 - download.com
 - 애드센스숨기기
 - java
 - 유틸리티
 - registry
 - 스크린캡쳐
 - tagREADYSTATE
 
| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
                    글 보관함