TStringList는 TStrings를 상속받아서 만들었기 때문입니다.
TMemo의 Lines
TComboBox , TListBox 의 Items
기타 매우 많은 vcl컴포넌트및 class의 프로퍼티가 이 TStrings 타입으로 되어있습니다.
그래서 TStringList를 완벽하게 이해하면..
매우 여러가지 부분에 효과적으로 쓸수 있습니다.
parsing , sorting , file-read /save ...등등..
그럼..
spark 님이 쓰신 글 :
:
:
: TStringList* listA = new TStringList;
: listA->Add("aaa");
: listA->Add("aaa");
: listA->Add("aaa");
:
: TStringList* listB = new TStringList;
: listB->Add("bbb");
: listB->Add("bbb");
: listB->Add("bbb");
:
: listB->AddStrings(listA);
:
: delete listA;
: delete listB;
:
:
:
: AddStrings() 의 전달인자를 보면 TStrings* 라고 되어 있는데요.
: TStringList*를 넣어줘도 되는군요!
: 위와같은 코드가 왜 가능한거지요?
|