#include<iostream>
#include<list>
using namespace std;
int main()
{
list<int> dob;
for(int i=0;i<5;i++)
{
dob.push_back(i);
}
for(int i=0,list<int>::iterator itr=dob.begin();i<3;itr++,i++)
cout<<*itr;
return 0;
}
errors--
test.cpp: In function `int main ()':
test.cpp:17: `iterator' specified as declarator-id
test.cpp:17: extraneous `int' ignored
test.cpp:17: `int list<int, allocator<int> >::iterator' is not a static
member of `class list<int, allocator<int> >'
test.cpp:17: parse error before `='
test.cpp:17: `itr' undeclared (first use this function)
test.cpp:17: (Each undeclared identifier is reported only once for each
function it appears in.)