针对该定义产生的错误信息:
error C2143: syntax error : missing ";" before "<"
error C2501: "CList" : missing storage-class or type specifiers
error C2059: syntax error : "<"
error C2238: unexpected token(s) preceding ";"
Error executing cl.exe.
需要加 #include <afxtempl.h>
myList.AddHead(CString("ABC"));
myList.AddHead(CString("def"));
myList.AddHead(CString("ghi"));
POSITION pos;
pos=myList.GetHeadPosition();
for(int i=0;i<myList.GetCount();i++)
{
// TRACE("%s\n",myList.GetNext(pos));
pos=myList.FindIndex(i);
TRACE("%s\n",myList.GetAt(pos));
}