Skip to content

Instantly share code, notes, and snippets.

@chomado
Created August 4, 2014 05:59
Show Gist options
  • Save chomado/531afdadfb4fd1cd483f to your computer and use it in GitHub Desktop.
Save chomado/531afdadfb4fd1cd483f to your computer and use it in GitHub Desktop.
vector, iterator. http://bituse.info/cp/10
#include <iostream>
#include <vector>
void func(std::vector<int>::iterator begin, std::vector<int>::iterator end)
{
while (++begin != end) {
std::cout << *begin << std::endl;
}
}
int main()
{
std::vector<int> test(10, 1);
std::vector<int>::iterator begin, end;
begin = test.begin();
end = test.end();
func(begin, end);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment