帮忙------------一个简单的C++问题,我就是找不到错在那儿?
#include "stdafx.h"
#include <afx.h>
#include <afxcoll.h>
class CAction:public CObject
{
public:
CAction(int nTime)
{
m_nTime=nTime;
}
void PrintTime()
{
TRACE("time=%d/n",m_nTime);
}
private:
int m_nTime;
};
int main(int argc, char* argv[])
{
CAction* pAction;
CObList actionList;
int i;
for (i=0;i<5;i++)
{
pAction=new CAction(i);
actionList.AddTail(pAction);
}
while (!actionList.IsEmpty())
{
pAction=(CAction*)actionList.RemoveHead();
pAction->PrintTime();
delete pAction;
}
pAction=NULL;
return 0;
}