Map, Iterator trong C++
Map, Iterator trong C++
I. Iterator:
1. Iterator là gì???
Iterator là một con trỏ được sử dụng để đại diện cho một phần tử nào đó.
map<int, string>::iterator it;
vector<int>::iterator it;
Được sử dụng đại diện cho các biến được trỏ đến để thực hiện các thao tác thêm, sửa, xóa, ..
vector<int> vInt;
vInt.push_back( 1 );
vector<int>::iterator it = vInt.begin();
Trong trường hợp này...
C++
1234