16,472
社区成员
发帖
与我相关
我的任务
分享
CList<CString,CString&> cl;
CString str1="a";
CString str2="b";
CString str3="c";
CString str4="d";
cl.AddHead(str1);
cl.AddHead(str2);
cl.AddHead(str3);
cl.AddHead(str4);
POSITION pos=cl.GetTailPosition();
CString data;
while (pos!=NULL)
{
data=cl.GetNext(pos);
m_listA.AddString(data);
}
// Define myList.
CList<CString,CString&> myList;
// Add two elements to the list.
myList.AddHead(CString("ABC"));
myList.AddHead(CString("123"));
// Dump the list elements to the debug window.
POSITION pos = myList.GetHeadPosition();
for (int i=0;i < myList.GetCount();i++)
{
TRACE("%s\r\n", (LPCSTR) myList.GetNext(pos));
}