int iNum = 1;
strTemp << "Test";
=> strTemp는 "Test001"이 된다.
'Programming > STL' 카테고리의 다른 글
list sort (0) | 2011.01.25 |
---|
list sort (0) | 2011.01.25 |
---|
#ifndef _MEMORYLEAK_H_
#define _MEMORYLEAK_H_
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
static class MemoryMng
{
public:
MemoryMng() {
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
}
~MemoryMng() {
_ASSERTE( _CrtCheckMemory( ) );
}
} MemoryLeak;
#endif // _DEBUG
#endif // _MEMORYLEAK_H_
#include "stdafx.h"
#include "MemoryLeak.h"
int _tmain(int argc, _TCHAR* argv[])
{
_CrtMemState ms;
for(int i = 0; i < 100; ++i)
{
int* p = new int;
}
//_CrtSetBreakAlloc(202); // 힙에 202번째로 메모리 할당을 요청하는 코드에서 브레이크
_CrtMemCheckpoint(&ms); // ms에 메모리 상태 저장
for(int i = 0; i < 200; ++i)
{
int* p = new int;
}
_CrtMemDumpAllObjectsSince(&ms); // ms에 저장된 메모리와 비교해서 누수된 메모리 리포트
_CrtDbgBreak();
return 0;
}
.................................................................
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {209} normal block at 0x00375D90, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {208} normal block at 0x00375D50, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {207} normal block at 0x00375D10, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {206} normal block at 0x00375CD0, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {205} normal block at 0x00375C90, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {204} normal block at 0x00375C50, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {203} normal block at 0x00375C10, 4 bytes long.
Data: < > CD CD CD CD
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {202} normal block at 0x00375BD0, 4 bytes long.
Data: < > CD CD CD CD
Object dump complete.
CrtDbgRoutine.exe이(가) 중단점을 트리거했습니다.
#pragma init_seg( {compiler | lib | user | "섹션이름"[, 함수이름]} ) (0) | 2011.06.07 |
---|---|
클래스 멤버 함수의 함수 포인터 사용 (1) | 2011.02.11 |
Visual Studio에서 파일 선택하면 솔루션 탐색기에서 파일 위치로 이동하게 설정 (0) | 2011.06.22 |
---|---|
Visual Studio 편집기에서 텍스트의 대/소문자 변경 (0) | 2011.06.15 |
조사식에서 utf8, utf16 스트링을 보는 방법 (0) | 2011.06.27 |
---|---|
Visual Studio 편집기에서 텍스트의 대/소문자 변경 (0) | 2011.06.15 |
텍스트를 모두 대문자로 변환하려면 대문자로를 선택하거나 Ctrl+Shift+U를 누릅니다.
— 또는 —
텍스트를 모두 소문자로 변환하려면 소문자로를 선택하거나 Ctrl+U를 누릅니다.
조사식에서 utf8, utf16 스트링을 보는 방법 (0) | 2011.06.27 |
---|---|
Visual Studio에서 파일 선택하면 솔루션 탐색기에서 파일 위치로 이동하게 설정 (0) | 2011.06.22 |
//CA.cpp
class CA
{
int a;
int b;
public:
CA();
~CA();
};
{
a = 10;
b = 10;
}
CA::~CA()
{
a = 10;
b = 10;
}
#pragma init_seg(lib)
CA ca;
//CB.cpp
class CB
{
int a;
int b;
public:
CB();
~CB();
};
{
a = 10;
b = 10;
}
CB::~CB()
{
a = 10;
b = 10;
}
#pragma init_seg(compiler)
CB cb;
//CC.cpp
class CC
{
int a;
int b;
public:
CC();
~CC();
};
{
a = 10;
b = 10;
}
CC::~CC()
{
a = 10;
b = 10;
}
#pragma init_seg(user)
CC cc;
CrtDbgRoutine - 메모리 누수 추적 (0) | 2011.07.09 |
---|---|
클래스 멤버 함수의 함수 포인터 사용 (1) | 2011.02.11 |
DataTable에서 데이터 삭제 (0) | 2011.06.03 |
---|---|
DataTable에 데이터 추가 (0) | 2011.06.03 |
sqlite (0) | 2011.05.30 |
DataGridView와 ContextMenu 연결 (0) | 2011.05.16 |
DataGridView와 sqlite 테이블 연결하기 (0) | 2011.05.16 |
DataTable table = new DataTable("Customers");
table.Rows[0].Delete();
table.AcceptChanges();
DataSets, DataTables 및 DataViews(ADO.NET) (0) | 2011.06.03 |
---|---|
DataTable에 데이터 추가 (0) | 2011.06.03 |
sqlite (0) | 2011.05.30 |
DataGridView와 ContextMenu 연결 (0) | 2011.05.16 |
DataGridView와 sqlite 테이블 연결하기 (0) | 2011.05.16 |
DataTable workTable = new DataTable("Customers");
DataRow workRow = workTable.NewRow();
workRow["CustLName"] = "Smith";
workRow[1] = "Smith";
workTable.Rows.Add(workRow);
workTable.AcceptChanges();
DataSets, DataTables 및 DataViews(ADO.NET) (0) | 2011.06.03 |
---|---|
DataTable에서 데이터 삭제 (0) | 2011.06.03 |
sqlite (0) | 2011.05.30 |
DataGridView와 ContextMenu 연결 (0) | 2011.05.16 |
DataGridView와 sqlite 테이블 연결하기 (0) | 2011.05.16 |
SQLiteConnection cn = new SQLiteConnection(Form1.dbQuery);
cn.Open();
string SQL;
SQL = "SELECT users_id, name, username, place FROM users";
SQLiteCommand cmd = new SQLiteCommand(SQL, cn);
SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
this.grid_userlist.DataSource = dt;
cn.Close();
DataTable에서 데이터 삭제 (0) | 2011.06.03 |
---|---|
DataTable에 데이터 추가 (0) | 2011.06.03 |
DataGridView와 ContextMenu 연결 (0) | 2011.05.16 |
DataGridView와 sqlite 테이블 연결하기 (0) | 2011.05.16 |
MDI 창 만들기 (0) | 2011.05.16 |