struct f_grid_info { //find grid info f_grid_info(int id) : id(id) {}
}grid_option, *pGrid_option; |
Header file |
grid_info gi; //init data //find data by id if (it != vgis.end()) { //modify data TRACE("after modify data : id = %d, titile = %s, option = %d\n", it->id, it->title, it->option); //find again if (it != vgis.end()) { //modify data TRACE("after modify data : id = %d, titile = %s, option = %d\n", it->id, it->title, it->option); |
src
|
std::vector< grid_info >::iterator it; for (it = vgis.begin(); it != vgis.end(); it++) { s.Format("%sid = %d, title = %s, value = %d\n", s, it->id, it->title, it->option); } CEdit* wEdit; wEdit = (CEdit*)GetDlgItem(IDC_STATIC); wEdit->SetWindowText(s); //設定 } |
印出全部 |
INIT |
|
Q:How to modify a struct element in a vector? Q:C++中find_if查找vector中的特定struct以及值 |
|
印出全部 |
|
留言列表