| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Interpolation Spline
- Verbose
- articles
- Ogre XML
- interpolation
- Form factor
- parser
- EngineKarbia Developing
- SpaceGoldRush
- Shader Model
- Certificated
- VC 6.0 컴파일러 오류
- 현실 도피
- ListTool
- Slerp
- Violation
- Cam Parser
- 리눅스 하드 추가
- msocache 제거
- Mesh Parser
- Camera Parser
- msocache
- Proteus VX
- EK3D
- Linux Shutdown
- Sgr
- 상콤한 에러?
- 이중 템플릿
- partition master
- VC 6.0 템플릿
Archives
- Today
- Total
Kevin Dominic의 Studying Rock Drill~
std::stringstream 사용법 본문
출처 : http://yegam400.tistory.com/523
----------------------------------------------------------------------------------------------------
STL을 사용할때 buffer와 sprintf를 사용하는 대신에 stringstream을 사용하는데 이것의 사용법은 대충 알았었는데 초기화를 몰라서 얼마전에 찾았다. 아래와 같이 사용하고, 초기화를 하면 재사용을 할수 있다.
#include <sstream>
std::stringstream ss;
std::string data="1";
ss << "value:" << data;
// ss.str()를 하면 std::string으로 리턴된다.
OutputDebugStringA(ss.str().c_str());
//초기화. ss.clear()를 하면 초기화가 되지 않음
ss.str("");
//초기화 된 상태에서 다른 목적으로 재사용 가능
ss << ...
'Study > 전공' 카테고리의 다른 글
| DirectX 사용시 D3DX Memory Leak 발생시 에러 위치 찾는 법 (0) | 2012.06.18 |
|---|---|
| 메모리 릭 찾아내기 (0) | 2012.01.22 |
| DirectX 기반 프로그램에서 메모리릭 발생시 찾아내는 방법 (0) | 2012.01.22 |
| IGameExporter에서 Mesh 추출 시 유의사항 (0) | 2011.08.16 |
| Remote Debugging (0) | 2011.07.29 |