initialising a list

list<int>::iterator itr;
for(itr=list2.begin;itr != list2.end;itr++)
{
*itr=rand()/100;
}


for the above code i am getting error like this....

23 C:\Users\venkata manne\Documents\list.cpp no match for 'operator=' in 'itr = list2.std::list<_Tp, _Alloc>::begin [with _Tp = int, _Alloc = std::allocator<int>]'

where as i dont see anything wrong with the above code....please help
hey ...i got it....i should have written as list2.begin() and list2.end()
Topic archived. No new replies allowed.