bcb vector使用
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);
补充:软件开发 , C++ ,