i've just started with c++ stl and i'm unable to figure out the error...your help be greatly appreciated...
int count = 0 ;
while (!s.empty())
{
s.erase(--s.end());
set<int >::iterator it;
for (it = s.begin(); it != s.end(); it++)
{
if (*it > 0)
* it -= r; //*error : expression must be modifiable lvalue
//r is a constant
else
s.erase(it);
}
count++;
}
cout << count;