CList myList;

  针对该定义产生的错误信息:  
  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));
 
 }

posted on 2008-03-04 10:00  wqj1212  阅读(684)  评论(0编辑  收藏  举报

导航