|
STL은 알고나면 쉽지만, 처음 배울때 헷갈리기가 쉽습니다.
당장 필요한 것이 AnsiString만 저장하는 자료구조라면,
TStringList를 쓰세요.
TList가 가진 객체 삽입/삭제에서의 문제점이 없으며,
AnsiString을 다루기에 편리한 기능을 제공합니다.
void __fastcall TForm1::ButtonClick1(TObject *Sender)
{
TStringList *TempList = new TStringList; // declare the list
try{
//use the string list
TempList->Add("hi");
... // 생략
}
__finally{
delete TempList; // destroy the list object
}
}
|