1、定義結構體 class vacation //jiao { public: AnsiString vname; AnsiString vdate; int status; }; 2、定義vector std::vector<vacation*> m_vacationDate; 3、讀取 vacation *pTemp=NULL; pTemp = new vacation(); if (NULL == pTemp) { return false; } for (std::vector<vacation *>::iterator it=m_vacationDate.begin();it<m_vacationDate.end();++it) { pTemp=*it; AnsiString aDate1=pTemp->vdate; } 4、放數據 vacation *pVacation=NULL; pVacation = new vacation(); if (NULL == pVacation) { return false; } pVacation->vdate=FormatDateTime("yyyy-mm-dd",startdate); m_vacationDate.push_back(pVacation);